boks_logger 0.1.0 copy "boks_logger: ^0.1.0" to clipboard
boks_logger: ^0.1.0 copied to clipboard

outdated

dez nutz

boks_logger #

Boks Logger is a library for printing data to console and actually logging it to files

Using #

class Logger({bool useAmerican: false}); // setting useAmerican to true makes the log file naming be in the american way (month-day-year)

void debug(String message);
void info(String message);
void success(String message);
void warning(String message);
void error(String message);

logger.fatal(String message, [Exception exception]);

Example #

First import the library

import "package:boks_logger/boks_logger.dart";

Then you can use the Logger class to... log stuff, they also print in different colors

The library has a default logger object, you can create different loggers from the Logger class, then you can change the color for all functions and change the log file naming to the american day system

logger.info("blue message");      // out: <h:M:s> [INFO] blue message
logger.debug("white message");    // out: <h:M:s> [DEBUG] white message
logger.success("green message");  // out: <h:M:s> [SUCCESS] green message
logger.warning("yellow message"); // out: <h:M:s> [WARNING] yellow message
logger.error("red message");      // out: <h:M:s> [ERROR] red message

logger.fatal(String message, [Exception exception]); // redder red also throw's an exception, you can specify an exception by by passing the Exception itself as a second (optinal argument, other wise normal exception)

Author #

  • Paulo Henrique Tulio - at least my name's there - PauloBoks
  • Devon Galat - Actual code - vxern

To do #

Proper documentation

License #

MIT