BrMemoryOutput class

Mantém os eventos em memória — ideal para testes e inspeção em tempo real.

final memory = BrMemoryOutput(maxRecords: 100);
final log = BrLogger(output: memory);

log.info('algo aconteceu');

expect(memory.records.last.level, BrLogLevel.info);
Inheritance

Constructors

BrMemoryOutput({int maxRecords = 200})

Properties

hashCode int
The hash code for this object.
no setterinherited
lines List<List<String>>
As linhas formatadas correspondentes a cada evento.
no setter
maxRecords int
final
records List<BrLogRecord>
Todos os eventos armazenados (mais recente no final).
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() → void
Limpa todos os registros armazenados.
dispose() → void
Limpeza opcional (fecha arquivo, etc.).
inherited
init() → void
Inicialização opcional (abre arquivo, conecta socket, etc.).
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
write(BrLogRecord record, List<String> lines) → void
Escreve lines no destino.
override

Operators

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