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)
|
## [v0.3.0](https://git.zhirov.kz/dlang/singlog/compare/v0.2.1...v0.3.0) (2023.04.28)
|
||||||
|
|
||||||
|
- Minor changes
|
||||||
|
|
||||||
### New
|
### New
|
||||||
|
|
||||||
- Windows OS Logging support
|
- 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)
|
[![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)
|
[![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
|
```d
|
||||||
import singlog;
|
import singlog;
|
||||||
|
|
||||||
void main()
|
void main(string[] argv) {
|
||||||
{
|
log.output(log.SYSLOG | log.STDOUT | log.FILE) // write to syslog, standard output stream and file
|
||||||
log.level(log.DEBUG);
|
.name(argv[0]) // program name as an identifier (for Windows OS)
|
||||||
// write to syslog and file
|
.level(log.DEBUGGING) // logging level
|
||||||
log.output(log.SYSLOG | log.FILE);
|
.file("./test.log"); // the path to the log file
|
||||||
log.file("./file.log");
|
|
||||||
log.warning("Hello, World!");
|
log.e("This is an error message");
|
||||||
log.w("The same thing");
|
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",
|
"license": "GPL-2.0",
|
||||||
"copyright": "© Alexander Zhirov, 2023",
|
"copyright": "© Alexander Zhirov, 2023",
|
||||||
"description": "Singleton for simple logging",
|
"description": "Singleton for simple logging",
|
||||||
"targetType": "library",
|
|
||||||
"targetPath": "lib",
|
|
||||||
"targetName": "singlog",
|
"targetName": "singlog",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
{
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
|
@ -124,9 +124,7 @@ version(Windows) {
|
||||||
if (!this.writeToFile)
|
if (!this.writeToFile)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (this.path.exists)
|
if (!this.path.exists) {
|
||||||
this.writeToFile = true;
|
|
||||||
else {
|
|
||||||
this.writeToFile = false;
|
this.writeToFile = false;
|
||||||
this.warning("The log file does not exist: " ~ this.path);
|
this.warning("The log file does not exist: " ~ this.path);
|
||||||
}
|
}
|
||||||
|
|
16
tests/test.d
16
tests/test.d
|
@ -1,11 +1,13 @@
|
||||||
import singlog;
|
import singlog;
|
||||||
|
|
||||||
void main(string[] argv) {
|
void main(string[] argv) {
|
||||||
log.output(log.SYSLOG | log.STDOUT | log.FILE)
|
log.output(log.SYSLOG | log.STDOUT | log.FILE) // write to syslog, standard output stream and file
|
||||||
.name(argv[0])
|
.name(argv[0]) // program name as an identifier (for Windows OS)
|
||||||
.level(Log.DEBUGGING)
|
.level(log.DEBUGGING) // logging level
|
||||||
.file("./test.log");
|
.file("./test.log"); // the path to the log file
|
||||||
log.e("hello!");
|
|
||||||
log.w("hello!");
|
log.e("This is an error message");
|
||||||
log.i("hello!");
|
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