dlog/docs/index.md

39 lines
1.0 KiB
Markdown
Raw Permalink Normal View History

2022-11-22 15:35:29 +00:00
dlog
====
**Simple and modular logging library**
## Usage
We recommend you use [dub](http://code.dlang.org) to add dlog to your project as follows:
```
dub add dlog
```
* [View on DUB](https://code.dlang.org/packages/dlog)
2024-04-10 16:04:13 +01:00
* [View API](https://dlog.dpldocs.info/)
2022-11-22 15:35:29 +00:00
## Components
dlog is formed out of two main components:
1. `Logger`
* The logger contains the needed barebones for facilitating the actual logging of text
2024-04-10 16:04:13 +01:00
* The _base logger_ (i.e. `Logger`) maintains a list of attaches _filters_, _message transformers_ and _handlers_
2. `Filter`
* Acts as a predicate on the incoming _message_ and determines whether it should be logged or not
* This is used by the `BasicLogger` to implement log levels
3. `Transform`
* A _message transform_ is attached to a logger and performs manipulation on the message logged
2022-11-22 15:35:29 +00:00
* They may be chained as to perform multiple transformations in a stream-like fashion
2024-04-10 16:04:13 +01:00
4. `Handler`
* A _handler_ handles the final transformed message, for some this means outputting to standard out, or a file
2022-11-22 15:35:29 +00:00
---
## License
2023-03-03 10:08:11 +00:00
LGPLv3
2022-11-22 15:35:29 +00:00