trace 0.0.7-prerelease copy "trace: ^0.0.7-prerelease" to clipboard
trace: ^0.0.7-prerelease copied to clipboard

Trace is a minimalistic logger for your Dart & Flutter projects, that uses AnsiX to print customizable messages in terminal and export log files.

example/main.dart

import 'package:trace/trace.dart';

void main() async {
  final ConsoleLogger logger = ConsoleLogger(
    filter: DefaultLogFilter(
      LogLevel.verbose,
      debugOnly: false,
    ),
  );

  Trace.registerLogger(logger);
  Trace.level = LogLevel.verbose;

  Trace.verbose('This is a verbose test message');
  Trace.debug(
    'This is a debug test message',
    data: <String, dynamic>{
      'user_id': 123,
      'email': 'tester@test.com',
      'is_admin': true,
    },
  );
  Trace.info('This is an info test message');
  Trace.success('This is a success test message');
  Trace.warning('This is a warning test message');
  Trace.error(
    'This is an error test message',
    error: Exception('Random exception'),
    stackTrace: StackTrace.current,
  );
  Trace.fatal(
    'This is a fatal test message',
    error: Exception('Critical exception'),
    stackTrace: StackTrace.current,
  );

  await Trace.dispose();
}
8
likes
160
points
307
downloads
screenshot

Publisher

verified publishernikosportolos.com

Weekly Downloads

Trace is a minimalistic logger for your Dart & Flutter projects, that uses AnsiX to print customizable messages in terminal and export log files.

Repository (GitHub)
View/report issues
Contributing

Topics

#trace #logging #print #console #file

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

ansix, collection, data_class_plugin, date_time_format, meta, path, rxdart, stack_trace

More

Packages that depend on trace