the_log

Compact, token-efficient logger for Flutter and Dart. Zero-noise by default: no ANSI colors, emojis, timestamps, or caller file paths — just [L] message. Built for AI agent consumption and CI pipelines where every token counts.

Features

  • Compact default format: [I] message — minimal, scannable, machine-friendly.
  • Six log levels: T (trace), D (debug), I (info), W (warning), E (error), F (fatal).
  • Automatic stack trace truncation: Only 3 relevant frames shown for errors.
  • Convenience functions: logInfo(), logError(), etc. — same API, zero noise.
  • Level filtering: Set minLevel to suppress low-priority logs in production.

Getting started

dependencies:
  the_log: ^1.1.0

Usage

import 'package:the_log/the_log.dart';

// Default global logger (compact mode)
logger.i('Application started');
logger.d('User data loaded: $count items');
logger.w('Cache miss for key: $key');
logger.e('Failed to load', error: err, stackTrace: stack);

// Convenience functions
logInfo('Ready');
logError('Something went wrong', error: e);

Custom configuration

final myLogger = AppLogger(
  minLevel: LogLevel.info, // suppress trace and debug
);

License

MIT

Libraries

the_log