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

The osum logging library by osumpi

example/osumlog.dart

import 'package:osumlog/osumlog.dart';
import 'package:osumlog/src/level.dart';

void main() {
  // All log levels with the `Log` constructor.
  for (final level in LogLevels.values) {
    Log('This is $level level log message', level: level);
  }

  // Log.<level>(..) usage.
  Log.error("Error");

  Log.warn("Warning");

  // Put timestamp along with the log message.
  Log.showTimestamp = true;

  Log.fatal("Fatal with timestamps");

  // Use symbols instead of log label flags.
  Log.showLevelSymbolInsteadOfLabel = true;

  Log.warn("Warning with symbol");

  Log.info(Log.loggingLevel.toString().trim());

  // Log level set to output all log messages.
  Log.loggingLevel = LogLevels.all;

  // Ignore colors when logging.
  Log.applyColors = false;

  Log.trace("Fatal but no colors :(");
}
2
likes
110
pub points
26%
popularity

Publisher

unverified uploader

The osum logging library by osumpi

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

LGPL-2.1 (LICENSE)

Dependencies

meta

More

Packages that depend on osumlog