diff --git a/packages/pretty_logging/lib/pretty_logging.dart b/packages/pretty_logging/lib/pretty_logging.dart index 30917c6b..bc45c81b 100644 --- a/packages/pretty_logging/lib/pretty_logging.dart +++ b/packages/pretty_logging/lib/pretty_logging.dart @@ -8,24 +8,24 @@ import 'package:io/ansi.dart'; /// /// You can also pass a custom [printFunction] or [logColorChooser]. void prettyLog(LogRecord record, - {bool Function(LogRecord) omitError, - void Function(String) printFunction, - AnsiCode Function(Level) logColorChooser}) { + {bool Function(LogRecord)? omitError, + void Function(String)? printFunction, + AnsiCode Function(Level)? logColorChooser}) { logColorChooser ??= chooseLogColor; omitError ??= (_) => false; printFunction ??= print; var code = logColorChooser(record.level); - if (record.error == null) printFunction(code.wrap(record.toString())); + if (record.error == null) printFunction(code.wrap(record.toString())!); if (record.error != null) { var err = record.error; if (omitError(record)) return; - printFunction(code.wrap(record.toString() + '\n')); - printFunction(code.wrap(err.toString())); + printFunction(code.wrap(record.toString() + '\n')!); + printFunction(code.wrap(err.toString())!); if (record.stackTrace != null) { - printFunction(code.wrap(record.stackTrace.toString())); + printFunction(code.wrap(record.stackTrace.toString())!); } } } diff --git a/packages/pretty_logging/pubspec.yaml b/packages/pretty_logging/pubspec.yaml index 6a3f7a16..5f693722 100644 --- a/packages/pretty_logging/pubspec.yaml +++ b/packages/pretty_logging/pubspec.yaml @@ -1,10 +1,10 @@ name: pretty_logging -version: 2.0.0 +version: 2.1.0 description: Standalone helper for colorful logging output, using pkg:io AnsiCode. author: Tobe Osakwe homepage: https://github.com/angel-dart/pretty_logging environment: - sdk: ">=2.10.0 <3.0.0" + sdk: '>=2.12.0 <3.0.0' dependencies: io: ^1.0.0 logging: ^1.0.0