flogger

Last updated:

0 purchases

flogger Image
flogger Images
Add to Cart

Description:

flogger

Flogger Dart Library #
Description #
Flogger is a simple yet powerful logging library for Dart applications. It supports various logging levels, such as debug, info, warning, and error, and provides beautifully formatted console output. This library is ideal for those who wish to keep track of activities within their application, find bugs, or monitor app performance.
Features #

Supports logging for debug, info, warning, and error levels.
Thread and source caller information.
Predefined log message templates with customizable tags.
Global toggling of log status.
Utilizes Dart's developer logging capabilities.

Installation #
To include this package in your Dart project, add it to your pubspec.yaml file:
dependencies:
flogger: ^latest_version
copied to clipboard
Then run pub get.
Usage #
First, import the package in your Dart code:
import 'package:flogger/flogger.dart';
copied to clipboard
Here are a few ways to use the library:
Debug Log #
// Singleton
var log = Flogger();

copied to clipboard
log.d(DateTime.now());
/*
[πŸ› [DEBUG]: FloggerTag]
╔═════════════════════════════════════════════════════════════════════════════════════╗
β•‘Thread: main, Source: #2 ExampleController.chooseDate (example/main.dart:13:13) β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ 2023-09-16 23:43:16.678749 β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
*/
copied to clipboard
Warning Log with Custom Tag #
log.w("Warning message", tag: "WarningTag");
/*
[️ [WARNING]: WarningTag]
╔═════════════════════════════════════════════════════════════════════════════════════╗
β•‘Thread: main, Source: #2 ExampleController.clickButton (example/main.dart:16:18)β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘ Warning message β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
*/
copied to clipboard
Error Log #
log.e({"error":"msg error" , "status": 404});
/*
[❌ [ERROR]: FloggerLogs]
╔═══════════════════════════════════════════════════════════════════════════════════════╗
β•‘Thread: main, Source: #2 ExampleController.requestServer (example/main.dart:13:13)β•‘
β•Ÿβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β•’
β•‘{error: msg error, status: 404} β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
*/
copied to clipboard
API #
Global Configurations #

isLoggingEnabled: Boolean to enable or disable logging globally.
globalLogTag: A string used as the global tag for the log if no tag is specified in the individual log methods.

Methods #

d(Object? obj, {String? tag}): Logs a debug message.
i(Object? obj, {String? tag}): Logs an info message.
w(Object? obj, {String? tag}): Logs a warning message.
e(Object? obj, {String? tag}): Logs an error message.

Contributions #
Contributions, issues, and feature requests are welcome!
License #
This project is licensed under the MIT License.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.