diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ed29d1..347204d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [v0.3.0](https://git.zhirov.kz/dlang/singlog/compare/v0.2.1...v0.3.0) (2023.04.28) + +### New + +- Windows OS Logging support + ## [v0.2.1](https://git.zhirov.kz/dlang/singlog/compare/v0.2.0...v0.2.1) (2023.03.29) ### New diff --git a/README.md b/README.md index 4ec6a2a..13e4d74 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ [![main](https://img.shields.io/badge/dynamic/json.svg?label=git.zhirov.kz&style=for-the-badge&url=https://git.zhirov.kz/api/v1/repos/dlang/singlog/tags&query=$[0].name&color=violet)](https://git.zhirov.kz/dlang/singlog) [![githab](https://img.shields.io/github/v/tag/AlexanderZhirov/singlog.svg?sort=semver&style=for-the-badge&color=blue&label=github)](https://github.com/AlexanderZhirov/singlog) [![dub](https://img.shields.io/dub/v/singlog.svg?sort=semver&style=for-the-badge&color=orange)](https://code.dlang.org/packages/singlog) +[![linux](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge&logo=linux&logoColor=black)](https://www.linux.org/) +[![windows](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge&logo=windows&logoColor=white)](https://support.microsoft.com/en-US/windows) Singleton for simple logging @@ -25,6 +27,12 @@ void main() ## Examples +Setting the name of the logged program (it matters for Windows OS): + +```d +log.name("My program"); +``` + Setting the error output level: ```d @@ -42,7 +50,6 @@ Assigning a target output: ```d log.output(log.SYSLOG); log.output(log.STDOUT); - ``` Setup and allowing writing to a file: @@ -64,6 +71,6 @@ log.i("Information message") => log.information("Information message"); log.d("Debugging message") => log.debugging("Debugging message"); ``` -## Dub +## DUB -Add a dependency on `"singlog": "~>0.2.1"`. +Add a dependency on `"singlog": "~>0.3.0"`. diff --git a/source/singlog.d b/source/singlog.d index 1d16720..717c1a6 100644 --- a/source/singlog.d +++ b/source/singlog.d @@ -18,6 +18,8 @@ alias log = Log.msg; Singleton for simple logging --- + // Setting the name of the logged program + log.name("My program"); // Setting the error output level log.level(log.DEBUG); log.level(log.ALERT); @@ -32,8 +34,6 @@ alias log = Log.msg; log.output(log.FILE); // Setup and allowing writing to a file log.file("./file.log"); - log.fileOn(); - log.fileOff(); // Output of messages to the log log.alert("Alert message"); log.critical("Critical message");