

In release mode all logs are omitted.IDE Performance Recommendations Disable unused pluginsĪccording to this Jake Wharton comment, plugins can be extremely useful, but they also noticeably slow down Android Studio. The default implementation ( DevelopmentFilter) shows all logs with level >= Logger.level while in debug mode. The LogFilter decides which log events should be shown and which don't. Import io, for example when using this library on the web.

You should probably do this unless there's a good reason you don't want to With the io package you can auto detect the lineLength and colors arguments.Īssuming you have imported the io package with import 'dart:io' as io youĬan auto detect colors with io.stdout.supportsAnsiEscapes and lineLength PrintTime: false // Should each log print contain a timestamp PrintEmojis: true, // Print an emoji for each log message MethodCount: 2, // number of method calls to be displayedĮrrorMethodCount: 8, // number of method calls if stacktrace is provided If you use the PrettyPrinter, there are more options: var logger = Logger( Output: null, // Use the default LogOutput (-> send everything to console) Printer: PrettyPrinter(), // Use the PrettyPrinter to format and print log When creating a logger, you can pass some options: var logger = Logger(įilter: null, // Use the default LogFilter (-> only log in debug mode) This hides all verbose, debug and info log events. To show only specific log levels, you can set: Logger.level = Level.warning Logger.wtf("What a terrible failure log") You can log with different levels: logger.v("Verbose log") Shake the phone or call LogConsole.open(context) from anywhere to show an on device console.

If you are creating a Flutter app, you can use the logger_flutter extension. Instead of a string message, you can also pass other objects like List, Map or Set. Just create an instance of Logger and start logging: var logger = Logger() Show some ❤️ and star the repo to support the project Resources: # Small, easy to use and extensible logger which prints beautiful logs.
