Crates.io | mdlogger |
lib.rs | mdlogger |
version | 0.1.1 |
source | src |
created_at | 2024-07-06 05:54:59.115184 |
updated_at | 2024-07-06 06:43:30.982466 |
description | Multi-device logging system library crate |
homepage | |
repository | https://github.com/fstafforte/mdlogger |
max_upload_size | |
id | 1293764 |
size | 585,420 |
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:
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:
MDLogger can receive external command to change configuration at run time.
configuration file documntation
external command documentation
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
Rev. 0.1.0 First issue
Rev. 0.1.1 Correct configuration documentation