init method

  1. @override
Future<Logger> init({
  1. bool? debug,
  2. int days = 3,
  3. String? pathStart,
})

Implementation

@override
Future<Logger> init({
  bool? debug,
  int days = 3,
  String? pathStart,
}) async {
  final myDebug = debug ?? kDebugMode;

  if (!kIsWeb) {
    final logFile =
        await getLogFile(myDebug, days: days, pathStart: pathStart);
    _logFile = logFile;
  }

  return MyLog.init(
    level: myDebug ? Level.ALL : Level.INFO,
    logFile: kIsWeb || _logFile == null ? null : File(_logFile!),
    append: !myDebug,
    consoleLog: (time, msg) => kIsWeb
        ? html.window.console.log('$time $msg')
        : myDebug
            ? debugPrint('$time $msg')
            : debugPrint(msg),
  );
}