Skip to content

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.

License

Notifications You must be signed in to change notification settings

malikwang/debug_log_console

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/Hide Basic
Operation on single log Operation 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: );
Parameter Required Format
msg Yes String
tag No String
level No DebugLogLevel
logConsoleController.logInfo(msg, tag: );
logConsoleController.logWarning(msg, tag: );
logConsoleController.logError(msg, tag: );

Notes

  • Other params
Parameter Format Description
enableConsoleWriteLog Bool The 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.
logConsoleCapacity int The 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:

Tag Description
All All the logs also show in this tag.
Default The 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.

About

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.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published