#logger #logging #log

memory_logger

A logger that buffers messages in memory, allowing arbitrary flushes

2 releases

0.1.1 Jun 17, 2020
0.1.0 Jun 17, 2020

#659 in Debugging

Download history 3/week @ 2024-11-13 7/week @ 2024-11-20 5/week @ 2024-11-27 16/week @ 2024-12-04 19/week @ 2024-12-11 2/week @ 2024-12-18 10/week @ 2025-01-15 4/week @ 2025-01-22 290/week @ 2025-02-05 46/week @ 2025-02-12 6/week @ 2025-02-19 7/week @ 2025-02-26

349 downloads per month
Used in 3 crates

MIT license

12KB
221 lines

Memory Logger

A logger that stores entries in memory, allowing late and sporadic consumption.

Cargo Documentation

Features

  • Two flavors: blocking and asynchronous.
  • Optional target matching using Regex.
  • Simple design, few dependencies, very fast to compile.
  • No unsafe code.

Blocking

Both logging and reading use a mutex around a single buffer, and therefore may block. This should be good enough for most scenarios, and has a smaller memory overhead and better locality (single buffer).

Asynchronous

Both logging and reading use a channel, and may never block. This should be faster for high contention scenarios, but has a higher memory overhead and worse locality.

Simplicity

Memory logger aims to be a simple logging mechanism. There are no plans to implement advanced features.

Licence

memory_logger is licenced under the MIT Licence.

Dependencies

~44–620KB
~11K SLoC