release v0.3.0
This commit is contained in:
parent
dd68352dd3
commit
c8e73f989c
|
@ -2,6 +2,8 @@
|
|||
|
||||
## [v0.3.0](https://git.zhirov.kz/dlang/singlog/compare/v0.2.1...v0.3.0) (2023.04.28)
|
||||
|
||||
- Minor changes
|
||||
|
||||
### New
|
||||
|
||||
- Windows OS Logging support
|
||||
|
|
20
README.md
20
README.md
|
@ -1,4 +1,4 @@
|
|||
# singlog
|
||||
![singlog](singlog.png)
|
||||
|
||||
[![license](https://img.shields.io/github/license/AlexanderZhirov/singlog.svg?sort=semver&style=for-the-badge&color=green)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
|
||||
[![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)
|
||||
|
@ -14,14 +14,16 @@ Singleton for simple logging
|
|||
```d
|
||||
import singlog;
|
||||
|
||||
void main()
|
||||
{
|
||||
log.level(log.DEBUG);
|
||||
// write to syslog and file
|
||||
log.output(log.SYSLOG | log.FILE);
|
||||
log.file("./file.log");
|
||||
log.warning("Hello, World!");
|
||||
log.w("The same thing");
|
||||
void main(string[] argv) {
|
||||
log.output(log.SYSLOG | log.STDOUT | log.FILE) // write to syslog, standard output stream and file
|
||||
.name(argv[0]) // program name as an identifier (for Windows OS)
|
||||
.level(log.DEBUGGING) // logging level
|
||||
.file("./test.log"); // the path to the log file
|
||||
|
||||
log.e("This is an error message");
|
||||
log.error("And this is also an error message");
|
||||
log.w("This is a warning message");
|
||||
log.i("This is an information message");
|
||||
}
|
||||
```
|
||||
|
||||
|
|
2
dub.json
2
dub.json
|
@ -7,8 +7,6 @@
|
|||
"license": "GPL-2.0",
|
||||
"copyright": "© Alexander Zhirov, 2023",
|
||||
"description": "Singleton for simple logging",
|
||||
"targetType": "library",
|
||||
"targetPath": "lib",
|
||||
"targetName": "singlog",
|
||||
"configurations": [
|
||||
{
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
|
@ -124,9 +124,7 @@ version(Windows) {
|
|||
if (!this.writeToFile)
|
||||
return;
|
||||
|
||||
if (this.path.exists)
|
||||
this.writeToFile = true;
|
||||
else {
|
||||
if (!this.path.exists) {
|
||||
this.writeToFile = false;
|
||||
this.warning("The log file does not exist: " ~ this.path);
|
||||
}
|
||||
|
|
16
tests/test.d
16
tests/test.d
|
@ -1,11 +1,13 @@
|
|||
import singlog;
|
||||
|
||||
void main(string[] argv) {
|
||||
log.output(log.SYSLOG | log.STDOUT | log.FILE)
|
||||
.name(argv[0])
|
||||
.level(Log.DEBUGGING)
|
||||
.file("./test.log");
|
||||
log.e("hello!");
|
||||
log.w("hello!");
|
||||
log.i("hello!");
|
||||
log.output(log.SYSLOG | log.STDOUT | log.FILE) // write to syslog, standard output stream and file
|
||||
.name(argv[0]) // program name as an identifier (for Windows OS)
|
||||
.level(log.DEBUGGING) // logging level
|
||||
.file("./test.log"); // the path to the log file
|
||||
|
||||
log.e("This is an error message");
|
||||
log.error("And this is also an error message");
|
||||
log.w("This is a warning message");
|
||||
log.i("This is an information message");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue