mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-07-21 05:38:42 -04:00
debugging work
This commit is contained in:
parent
739df7c427
commit
d6b1c20906
71 changed files with 4155 additions and 3616 deletions
|
@ -1,5 +1,8 @@
|
|||
import 'dart:convert';
|
||||
|
||||
import 'package:bloc/bloc.dart';
|
||||
import 'package:loggy/loggy.dart';
|
||||
import 'package:veilid_support/veilid_support.dart';
|
||||
import 'loggy.dart';
|
||||
|
||||
const Map<String, LogLevel> _blocChangeLogLevels = {
|
||||
|
@ -38,7 +41,12 @@ class StateLogger extends BlocObserver {
|
|||
void onChange(BlocBase<dynamic> bloc, Change<dynamic> change) {
|
||||
super.onChange(bloc, change);
|
||||
_checkLogLevel(_blocChangeLogLevels, LogLevel.debug, bloc, (logLevel) {
|
||||
log.log(logLevel, 'Change: ${bloc.runtimeType} $change');
|
||||
const encoder = JsonEncoder.withIndent(' ', DynamicDebug.toDebug);
|
||||
log.log(
|
||||
logLevel,
|
||||
'Change: ${bloc.runtimeType}\n'
|
||||
'currentState: ${encoder.convert(change.currentState)}\n'
|
||||
'nextState: ${encoder.convert(change.nextState)}\n');
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue