BrLogger class

Logger puro para Dart/Flutter — zero dependências externas.

Pipeline: BrLoggerBrLogFilterBrLogPrinterBrLogOutput

Uso básico

final log = BrLogger(tag: 'Auth');

log.trace('iniciando handshake');
log.debug('userId: $id');
log.info('login bem-sucedido');
log.warning('token expira em 5 min');
log.error('falha na requisição', error: e, stackTrace: st);
log.fatal('banco de dados indisponível');

Customizando

final log = BrLogger(
  tag: 'Pagamento',
  filter: BrProductionFilter(),
  printer: BrPrettyPrinter(showTime: true),
  output: BrMultiOutput([BrDeveloperOutput(), BrMemoryOutput()]),
);

Constructors

BrLogger({String tag = '', BrLogFilter? filter, BrLogPrinter? printer, BrLogOutput? output})
Cria um logger e inicializa seu output.

Properties

filter BrLogFilter
Filtro que decide quais eventos seguem pelo pipeline.
final
hashCode int
The hash code for this object.
no setterinherited
output BrLogOutput
Destino que recebe as linhas formatadas.
final
printer BrLogPrinter
Printer que transforma cada evento aceito em linhas de texto.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tag String
Tag anexada aos eventos produzidos por esta instância.
final

Methods

debug(Object? message, {Object? error, StackTrace? stackTrace}) → void
Informações de debug — útil durante desenvolvimento. Cor: azul.
dispose() → void
Libera recursos do output (fecha arquivos, sockets, etc.).
error(Object? message, {Object? error, StackTrace? stackTrace}) → void
Erros recuperáveis. Cor: vermelho.
fatal(Object? message, {Object? error, StackTrace? stackTrace}) → void
Erros críticos — app não pode continuar. Cor: vermelho bold.
info(Object? message, {Object? error, StackTrace? stackTrace}) → void
Eventos normais do fluxo. Cor: verde.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
trace(Object? message, {Object? error, StackTrace? stackTrace}) → void
Rastreamento detalhado — mais verboso. Cor: cinza.
warning(Object? message, {Object? error, StackTrace? stackTrace}) → void
Situações inesperadas não críticas. Cor: laranja.

Operators

operator ==(Object other) bool
The equality operator.
inherited