singlog 0.1.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.msg.level(Log.DEBUG);
    Log.msg.output(Log.SYSLOG);
    Log.msg.file("./file.log");
    Log.msg.warning("Hello, World!");
}

Examples

Setting the error output level:

Log.msg.level(Log.DEBUG);
Log.msg.level(Log.ALERT);
Log.msg.level(Log.CRIT);
Log.msg.level(Log.ERR);
Log.msg.level(Log.WARNING);
Log.msg.level(Log.NOTICE);
Log.msg.level(Log.INFO);

Assigning a target output:

Log.msg.output(Log.SYSLOG);
Log.msg.output(Log.STDOUT);

Setup and allowing writing to a file:

Log.msg.file("./file.log");
Log.msg.fileOn();
Log.msg.fileOff();

Output of messages to the log:

Log.msg.alert("Alert message");
Log.msg.critical("Critical message");
Log.msg.error("Error message");
Log.msg.warning("Warning message");
Log.msg.notice("Notice message");
Log.msg.informations("Information message");
Log.msg.debugging("Debugging message");

Dub

Add a dependency on "singlog": "~>0.1.0".

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
Show all 9 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 2 downloads this month

  • 276 downloads total

Score:
0.7
Short URL:
singlog.dub.pm