paw 0.0.2 paw: ^0.0.2 copied to clipboard
Small, organised and easy to use logger for your flutter and dart apps.
PAW 🐾 #
Paw is a compact, well-organized, and user-friendly logging tool for your apps. It's designed to log your code's journey with structure and clarity, leaving a trace of each step like a paw print.
Features: #
- Easy to integrate and use in any Dart or Flutter project.
- Customizable log levels for better control and clarity.
- Lightweight design with a focus on performance.
Quick Links: #
Getting Started #
Let's get started with Paw!
Installation #
You can directly install it by adding paw: ^0.0.2
to your pubspec.yaml dependencies section.
You can also add 🐾 to your project by executing,
- Flutter -
flutter pub add paw
- Dart -
dart pub add paw
Setup #
To start using Paw in your project first initialize it at the root of your project.
// Initialize Paw logger at the root of your project
Paw.init(
name: "myApp",
maxStackTraces: 5,
shouldPrintName: true,
shouldPrintLogs: true,
shouldIncludeSourceInfo: false,
);
That's all! You're good to go to use paw in your apps. Refer to docs for more info.
Outputs #
Paw provides clear and organized log outputs, making debugging and monitoring an easy task. Here's an example of what Paw's outputs look like:
Documentation #
Also have in depth look at all the public API references
Paw
#
Paw
is a singleton class. Initialize this class at the root of your application and use its
instance anywhere in your code.
Paw.init({...});
Initialization Parameters:
name
: The name of your application. Used for better identification in logs. Default is "paw"maxStackTraces
: Maximum number of stack traces to log. Useful for in-depth debugging. Default is 5shouldPrintName
: Determines if the app name should be included in each log. Default is trueshouldPrintLogs
: Toggle to enable or disable log printing. Default is trueshouldIncludeSourceInfo
: Include source file and line number information in logs. Default is true
Log Methods #
info
Log informational messages. Ideal for general app behaviors and states.
Paw().info('This is an informational message');
warn
Log warnings. Use this for non-critical issues that should be noted.
Paw().warn('This is a warning message');
debug
Log debugging information. Essential for troubleshooting and understanding complex flows.
Paw().debug({'key': 'value', 'count': 42});
error
Log errors with detailed information, including error objects and stack traces. Critical for error tracking.
try {
// Code that might throw an error
} catch (e, stackTrace) {
Paw().error('An unexpected error occurred', error: e, stackTrace: stackTrace);
}
Contributing #
We welcome contributions! If you'd like to improve Paw, please open an issue or an PR with your suggested changes on this repo. Happy Coding 🐾!