debug_log_console 1.1.0
debug_log_console: ^1.1.0 copied to clipboard

Using a draggable and hoverable panel to display the key info/log of app state, network requests, etc. The info/log can be copied or shared as file.

DebugLogConsole #

Using a draggable and hoverable panel to display the key info/log of app state, network requests, etc. The info/log can be copied or shared as file.

Features #

  • The console is Draggable and can be Minimized.
  • Each info/log can be added with a tag and level. Tags are free to add and have Unread Count reminder. Level is divided into Info/Warning/Error.
  • The console implements:
    • Long Press to copy single log
    • Tap to display full content of single log
    • Copy recent 50/100 logs
    • Share all logs as .txt file
    • Clear all

Demo #

Show/Draggable/Minimized/HideBasic
Operation on single logOperation on logs

How to use #

Use DebugLogConsole wrap app homepage.

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'DebugLogConsole',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: DebugLogConsole(
        child: MyHomePage(title: 'DebugLogConsole'),
      ),
    );
  }
}

Show console

logConsoleController.showConsole();

Remove console

logConsoleController.removeConsole();

Methods #

logConsoleController.log(msg, tag: , level: );
ParameterRequiredFormat
msgYesString
tagNoString
levelNoDebugLogLevel
logConsoleController.logInfo(msg, tag: );
logConsoleController.logWarning(msg, tag: );
logConsoleController.logError(msg, tag: );

Notes #

  • Other params
ParameterFormatDescription
enableConsoleWriteLogBoolThe default value is False and set to True when console is showing. You can mannully change this value depends on your app env, for example, enable this flag when app in Debug env.
logConsoleCapacityintThe max count of logs and default value is 1000. The extra logs would not be cleared immediately, but at the timing of minimizing the console.
  • About tag

There are two pre-defined tags in the console:

TagDescription
AllAll the logs also show in this tag.
DefaultThe parameter tag in logConsoleController.log(...) is optional, so these logs are untagged would show in this tag.

Future work #

  • Support custom icon.
  • Support custom log level and color.
  • Support change pre-defined tags.
3
likes
90
pub points
54%
popularity

Publisher

malikwang.com

Using a draggable and hoverable panel to display the key info/log of app state, network requests, etc. The info/log can be copied or shared as file.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, path_provider, share_extend

More

Packages that depend on debug_log_console