ubuntu_logger 0.1.1 copy "ubuntu_logger: ^0.1.1" to clipboard
ubuntu_logger: ^0.1.1 copied to clipboard

A logging frontend based on Google's logging library for Dart.

Ubuntu Logger for Dart #

pub license: MPL CI codecov

A logging frontend based on Google's logging library for Dart.

Usage #

Import the library:

import 'package:ubuntu_logger/ubuntu_logger.dart';

Setup logging:

void main() {
  Logger.setup(
    path: '/path/to/file.log',
    level: LogLevel.info,
  );
}

Log messages:

final log = Logger('a_context');

log.debug('This is a debug message.');
log.info('This is an info message.');

Prints to the console:

INFO a_context: This is an info message.

Writes to the log file:

YYYY-MM-DD HH:MM:SS.zzzzzz INFO a_context: This is an info message.