mirror of
https://gitlab.com/veilid/veilid.git
synced 2025-06-25 07:10:48 -04:00
no-std-net fix
more network refactor
This commit is contained in:
parent
18a227717c
commit
909aa14fe2
17 changed files with 667 additions and 357 deletions
|
@ -12,6 +12,18 @@ import 'config.dart';
|
|||
// Loggy tools
|
||||
const LogLevel traceLevel = LogLevel('trace', 1);
|
||||
|
||||
class ConsolePrinter extends LoggyPrinter {
|
||||
ConsolePrinter(this.childPrinter) : super();
|
||||
|
||||
final LoggyPrinter childPrinter;
|
||||
|
||||
@override
|
||||
void onLog(LogRecord record) {
|
||||
debugPrint(record.toString());
|
||||
childPrinter.onLog(record);
|
||||
}
|
||||
}
|
||||
|
||||
extension TraceLoggy on Loggy {
|
||||
void trace(dynamic message, [Object? error, StackTrace? stackTrace]) =>
|
||||
log(traceLevel, message, error, stackTrace);
|
||||
|
@ -25,13 +37,12 @@ LogOptions getLogOptions(LogLevel? level) {
|
|||
}
|
||||
|
||||
void setRootLogLevel(LogLevel? level) {
|
||||
print("setRootLogLevel: $level");
|
||||
Loggy('').level = getLogOptions(level);
|
||||
}
|
||||
|
||||
void initLoggy() {
|
||||
Loggy.initLoggy(
|
||||
logPrinter: StreamPrinter(
|
||||
logPrinter: ConsolePrinter(
|
||||
const PrettyDeveloperPrinter(),
|
||||
),
|
||||
logOptions: getLogOptions(null),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue