singlog 0.2.0
Singleton for simple logging
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
singlog
Singleton for simple logging
Basic Usage
import simplog;
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!");
}
Examples
Setting the error output level:
log.level(log.DEBUG);
log.level(log.ALERT);
log.level(log.CRIT);
log.level(log.ERR);
log.level(log.WARNING);
log.level(log.NOTICE);
log.level(log.INFO);
Assigning a target output:
log.output(log.SYSLOG);
log.output(log.STDOUT);
Setup and allowing writing to a file:
log.output(log.FILE);
log.file("./file.log");
Output of messages to the log:
log.alert("Alert message");
log.critical("Critical message");
log.error("Error message");
log.warning("Warning message");
log.notice("Notice message");
log.informations("Information message");
log.debugging("Debugging message");
Dub
Add a dependency on "singlog": "~>0.2.0"
.
- Registered by Alexander Zhirov
- 0.2.0 released a year ago
- AlexanderZhirov/singlog
- git.zhirov.kz/dlang/singlog.git
- GPL-2.0
- © Alexander Zhirov, 2023
- Authors:
- Dependencies:
- datefmt
- Versions:
-
0.5.0 2023-Jul-21 0.4.0 2023-Jun-07 0.3.2 2023-Jun-01 0.3.1 2023-May-30 0.3.0 2023-Apr-30 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
2 downloads this month
-
276 downloads total
-
- Score:
- 0.7
- Short URL:
- singlog.dub.pm