Serial output logger based on the LoggerInterface
Fork of LogIt by
README.md
- Committer:
- Nico De Witte
- Date:
- 2016-12-14
- Revision:
- 5:e16468c1160f
File content as of revision 5:e16468c1160f:
# Mbed LogIt Logger library that is build based on the LoggerInterface library that follows the PSR-3 logger standard. This library provides an abstract class logable to make your classes easily Logger aware. Besides that the LogIt library also has a SerialLogger implementation and a NullLogger for production applications where no logging should be done. NullLogger is used as a default when making your classes Logger aware. It is implemented using the Singleton pattern to avoid waste of resources. ## Using LogIt First make your class inherit from Logable as such ```C++ class Router : public LogIt::Logable { //... }; ``` Now you can use the `set_logger()` method to inject a logger into the class or you can provide it as an optional argument to your constructors as shown below: ```C++ Router::Router(int address, Log::LoggerInterface * logger = 0) { set_logger(logger); logger->info("Setting up the router"); //... } ``` ## Dependencies This library currently only depends on the LoggerInterface itself which can be found at [https://developer.mbed.org/users/dwini/code/LoggerInterface/](https://developer.mbed.org/users/dwini/code/LoggerInterface/)