flutter_logcat_transparent


Pub Version

In Flutter, logs are displayed in the console without any distinguishing colors.
However, by using this package, you can view messages in the console with colors that you define.
Additionally, you can configure it so that logs are hidden in debug mode, and you can also set it to display tags, file paths, and timestamps.


๐Ÿ“ธ Demo

In Console

image

๐ŸŒฑ Getting Started

Install Package

flutter_logcat need only three parameters there are message, tag, path, time

  • message : If yon want input message to watch on console.
  • tag: Custom own your's tag name.
  • path: You can watch file preference path. (default: false)
  • time: You can watch current time. (default: false)

๐Ÿ’Œ Console Print

Parameters

parameter required type default output
message :heavy_check_mark: String [className:lineNumber] message
tag :x: String (tag) [className:lineNumber] message
path :x: bool false [className(packageName/className.dart):lineNumber] message
time :x: bool false 2024-09-25T00:00:000.000000:[className:linenumber] message

๐Ÿš€ Usage

  • Show only 'message'

    Log.v([String]);
Log.v("message");
Log.i("message");
Log.d("message");
Log.w("message");
Log.e("message");

_ExampleScreenState:30 message
image


  • Show 'message' & 'path'

    Log.v([String], path: [Boolean])
Log.v("message", path: true);
Log.i("message", path: true);
Log.d("message", path: true);
Log.w("message", path: true);
Log.e("message", path: true);

_ExampleScreenState(example/main.dart):35 message
image


  • Show 'message' & 'tag'

    Log.v([String], tag: [String])
Log.v("message", tag: "donguran");
Log.i("message", tag: "donguran");
Log.d("message", tag: "donguran");
Log.w("message", tag: "donguran");
Log.e("message", tag: "donguran");

(donguran) _ExampleScreenState(example/main.dart):48 message
image


  • Show 'message' & 'tag'

    Log.v([String], tag: [String])
Log.v("message", time: true);
Log.i("message", time: true);
Log.d("message", time: true);
Log.w("message", time: true);
Log.e("message", time: true);

2024-09-25T00:00:000.000000:className:linenumber message
image


๐Ÿงญ Set Log Configure

It's okay if you don't declare this function.
You only need to use it when an overall setup is required.

  • visible
  • tag
  • time
  • Control Visible๐Ÿ‘€ to Log.

    Log.configure(visible: [Boolean])
import 'package:flutter/foundation.dart';

Log.configure(visible: kDebugMode);
  • If you want setting default tag

    Log.configure(visible: [Boolean], tag: [String])
Log.configure(visible: kDebugMode, tag: "donguran");

Log.v(...);
Log.i(...);
...

image

  • If you want to see time this

    Log.configure(visible: [Boolean], time: [Boolean])
Log.configure(visible: true, time: true);
image

Libraries

flutter_logcat