Skip to content

Logger for `std.experimental.logger` that supports coloring the messages

Notifications You must be signed in to change notification settings

joakim-brannstrom/colorlog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

colorlog Build Status

colorlog is a logger intended to be used with std.experimental.logger. It adds two loggers and functionality to add console colors to messages.

Usage

The simples way to use colorlog is to call the config function. It takes care of creating a shared logger instance and registering it.

import colorlog;
// set the loglevel to info and register a SimpleLogger.
confLogger(VerboseMode.info);

Messages from logger will now have there loglevel colored. If additional coloring is desired the message can be manually colored.

logger.info("foo", "my message".color(Color.green).bg(Background.cyan).mode(Mode.bold));

Credit

Credit goes to the developers of dub. A significant part of the color handling is copied from that project.

Credit also goes to the developer of colorize for the inspiration.

About

Logger for `std.experimental.logger` that supports coloring the messages

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published