rlog 0.0.1+1 copy "rlog: ^0.0.1+1" to clipboard
rlog: ^0.0.1+1 copied to clipboard

retractedoutdated

An easy-to-use logging library with some presets.

An easy-to-use logging library with some presets.

Features #

  • Create a logger that log messages in your style.
  • Preset loggers/encoders/writers.
  • Rotation logger.

Getting started #

Add to pubspec.yaml.

dependencies:
  rlog: <version>

Usage #

/// Console logger
final logger = Logger.console();

logger.debug('some texts');
logger.error('some texts');
/// Rotation logger
final logger = Logger.build(
  encoder: ConsoleEncoder(),
  writer: RotationWriter(
    join(Directory.current.path, 'test-rotation.log'),
    maxCount: 16,
    maxSize: 1 << 12,
  ),
);

for (var i = 0; i < 1000; i++) {
  logger.info('test '.padRight(1 << 6, 'test '));
}
/// Rotation logger
final logger = Logger.build(
  encoder: ConsoleEncoder(),
  writer: MultiWriter([
      ConsoleWriter(),
      FileWriter(
      join(Directory.current.path, 'test-multi.log'),
    )
  ]),
);

for (var i = 0; i < 10; i++) {
  await Future.delayed(Duration(milliseconds: 20));
  logger.info('test test');
}
2
likes
0
pub points
59%
popularity

Publisher

verified publisherronbb.fun

An easy-to-use logging library with some presets.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

path

More

Packages that depend on rlog