getLogger static method

Logger getLogger({
  1. bool enableLog = true,
})

Implementation

static Logger getLogger({bool enableLog = true}) {
  if (!getIt.isRegistered<Logger>()) {
    getIt.registerLazySingleton<Logger>(() {
      return Logger(
        printer: SimplePrinter(
          printTime: true,
          colors: false,
        ),
        filter: AllLogsFilter(enableLog: enableLog),
        output: CustomConsoleOutput(),
      );
    });
  }
  return getIt<Logger>();
}