boks_logger 0.2.1

Dart native
Flutter Android iOS

Library for printing and logging

Boks_logger #

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

Basic Example #

import 'package:boks_logger/boks_logger.dart';

void main() {
  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("very red message"); // out: <h:M:s> [FATAL] very red message
}

METHODS: Logger #

Info, Debug, Success, Warning, Error: #

void debug(String message);
void info(String message);
void success(String message);
void warning(String message);
void error(String message);
Parameters
  • [String] message = The message to be printed and logger comes out as <h:M:s> [$SEVERITY] $message where <h:M:s> is the current time.
Usage example
logger.info("the 3 numbers on the back of your mom's credit card is crutial for the mission");
logger.error("credit card details not acquired");

Fatal error: #

void fatal(String message, [Exception exception]);
Parameters
  • [String] message = The message to be printed and logger comes out as <h:M:s> [FATAL] $message
  • [Exception] exception = Throw's this exception (not at the fatal() call for now, i'll fix that)
Usage example
logger.fatal("r/cringetopia voted, i am now 98% cringe 1% satire and 1% meta, i must go");

Creating new loggers #

class Logger({bool useAmerican: false});

Parameters #

  • [bool] useAmerican = If set to true will use M-d-y for the log file name, false by default

Usage example #

Logger myLogger = Logger(useAmerican: true); // uses american version of log file

myLogger.currentSeverity = Severity.Success; // only messages from success or above will be printed
myLogger.debugColor = AnsiPen()..black(); // makes the debug print black on the terminal, needs to import ansicolor

myLogger.debug("what if this text was black, that would cool i think");

Author #

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

To do #

Proper documentation

License #

MIT