mdlogger

Crates.iomdlogger
lib.rsmdlogger
version0.1.1
sourcesrc
created_at2024-07-06 05:54:59.115184
updated_at2024-07-06 06:43:30.982466
descriptionMulti-device logging system library crate
homepage
repositoryhttps://github.com/fstafforte/mdlogger
max_upload_size
id1293764
size585,420
Fabio Stafforte (fstafforte)

documentation

https://docs.rs/mdlogger

README

MDLOGGER

Rust lib: Multi-device logger

This library crate implements a logging system that is able to log message on different devices at same time.
Each device is managed by an object that implements LogHandler trait.
There are 4 predefined log handler:

  • Console
  • Rolling file
  • Network socket (udp, tcp, multicat)
  • Unix domain socket (udp, tcp Windows OS tcp only)

These predefined log handler are registered in the initialize function.
You can implement your own handler and register it [see register_log_handler_factory funtion in the documentation] before call the initialize function.
The logger is configured using a text file with a classic .ini syntax

Logging message can be identify by a category (a free text tag that could be print out with in log message) and a type, there are 5 type of messages:

  1. Debug
  2. Info
  3. Warning
  4. Critical
  5. Fatal

MDLogger can receive external command to change configuration at run time.

configuration file documntation

external command documentation

HOW MDLOGGER WORKS

To prevent a multi-threaded process from being slowed down as little as possible by log messaging, mdlogger creates its own logging thread where log messages are handled by different log hanlers created via the configuration file. The log function (and the related macros) do nothing more than insert the messages into a queue and then release control to the application process as quickly as possible. The queued messages will be dequeued by the log thread which will pass them to each log handler that will format them according to the configuration chosen for that handler which will then carry out its log function

This software is under [MIT OR Apache-2.0]
https://mit-license.org/
https://www.apache.org/licenses/LICENSE-2.0

MSRV 1.76.0

History

Rev. 0.1.0 First issue
Rev. 0.1.1 Correct configuration documentation

Commit count: 22

cargo fmt