Description

Colored logger for TTY

Package Information

Version0.1.0 (2015-Dec-15)
Repositoryhttps://github.com/repeatedly/colored-logger
LicenseBSL-1.0
CopyrightCopyright © 2015, Masahiro Nakagawa
AuthorsMasahiro Nakagawa
Registered byMasahiro Nakagawa
Dependenciesnone

Installation

To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

Readme

Colored Logger

Color your log message.

This depends on std.experimental.logger.

Example

import coloredlogger;
import std.experimental.logger : LogLevel;
import std.stdio : stdout;

void main()
{
    auto logger = new ColoredLogger(stdout, LogLevel.all);

    logger.trace("trace");
    logger.info("info");
    logger.warning("warning");
    logger.error("error");
    logger.critical("critical");
    logger.fatal("fatal");
}

example

Change color

You can change color setting by passing string[LogLevel] object to 2nd argument.

new ColoredLogger(stdout, [LogLevel.info : ColoredLogger.Color.White], LogLevel.all);

Copyright (c) 2015- Masahiro Nakagawa

License

Distributed under the Boost Software License, Version 1.0.

Available versions

0.1.0 ~master