paw 0.0.2 copy "paw: ^0.0.2" to clipboard
paw: ^0.0.2 copied to clipboard

Small, organised and easy to use logger for your flutter and dart apps.

PAW 🐾 #

pub package CI Last Commits Pull Requests Code size License

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.

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:

Paw Showcase

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 5
  • shouldPrintName: Determines if the app name should be included in each log. Default is true
  • shouldPrintLogs: Toggle to enable or disable log printing. Default is true
  • shouldIncludeSourceInfo: 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 🐾!

11
likes
0
pub points
33%
popularity

Publisher

unverified uploader

Small, organised and easy to use logger for your flutter and dart apps.

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on paw