{"id":27455934,"url":"https://github.com/adityamotale/paw","last_synced_at":"2026-05-04T00:31:07.594Z","repository":{"id":213691286,"uuid":"734687704","full_name":"AdityaMotale/paw","owner":"AdityaMotale","description":"Paw 🐾 is a logging tool that prioritizes accessibility and readability, while also offering highly customizable logs","archived":false,"fork":false,"pushed_at":"2024-04-20T13:16:55.000Z","size":2827,"stargazers_count":3,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-11T14:01:39.112Z","etag":null,"topics":["dart","flutter","logging"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/paw","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AdityaMotale.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-22T10:39:52.000Z","updated_at":"2025-06-17T05:17:39.000Z","dependencies_parsed_at":"2023-12-27T12:42:58.872Z","dependency_job_id":"3d42fae3-e228-47d3-83bf-a9a5ccdbb132","html_url":"https://github.com/AdityaMotale/paw","commit_stats":null,"previous_names":["adityamotale/paw","frozen-beak/paw"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/AdityaMotale/paw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdityaMotale%2Fpaw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdityaMotale%2Fpaw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdityaMotale%2Fpaw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdityaMotale%2Fpaw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AdityaMotale","download_url":"https://codeload.github.com/AdityaMotale/paw/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdityaMotale%2Fpaw/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32590081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"ssl_error","status_checked_at":"2026-05-03T22:09:10.534Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dart","flutter","logging"],"created_at":"2025-04-15T17:12:50.877Z","updated_at":"2026-05-04T00:31:07.507Z","avatar_url":"https://github.com/AdityaMotale.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PAW 🐾\n\n[![pub package](https://img.shields.io/pub/v/paw.svg?logo=dart\u0026logoColor=00b9fc)](https://pub.dev/packages/paw)\n[![CI](https://img.shields.io/github/actions/workflow/status/AdityaMotale/paw/unit_tests.yaml?branch=main\u0026logo=github-actions\u0026logoColor=white)](https://github.com/AdityaMotale/paw/actions)\n[![Last Commits](https://img.shields.io/github/last-commit/AdityaMotale/paw?logo=git\u0026logoColor=white)](https://github.com/AdityaMotale/paw/commits/main)\n[![Pull Requests](https://img.shields.io/github/issues-pr/AdityaMotale/paw?logo=github\u0026logoColor=white)](https://github.com/AdityaMotale/paw/pulls)\n[![GitHub Issues or Pull Requests](https://img.shields.io/github/issues/AdityaMotale/paw?logo=github\u0026logoColor=white)](https://github.com/AdityaMotale/paw/issues)\n[![Code size](https://img.shields.io/github/languages/code-size/AdityaMotale/paw?logo=github\u0026logoColor=white)](https://github.com/AdityaMotale/paw)\n[![License](https://img.shields.io/github/license/AdityaMotale/paw?logo=open-source-initiative\u0026logoColor=green)](https://github.com/AdityaMotale/paw/blob/main/LICENSE)\n\nPaw 🐾 is a logging tool that prioritizes accessibility and readability, while also offering highly customizable logs\n\n### Quick Links\n\n- [Installation](#installation)\n- [Getting Started](#getting-started)\n- [Log Levels](#log-levels)\n- [Themes](#themes)\n- [Custom Themes](#custom-themes)\n- [Efficient Usage Practices](#efficient-usage-practices)\n- [Contributing](#contributing)\n\n## Installation\n\nYou can directly install Paw 🐾 by adding `paw: ^0.0.4` to your _pubspec.yaml_ dependencies section\n\nYou can also add Paw 🐾 to your project by executing,\n\n- For Flutter Project - `flutter pub add paw`\n- For Dart Project - `dart pub add paw`\n\n## Getting Started\n\nGetting started with Paw 🐾 is easy! You can integrate it into your project by fallowing ways:\n\n- [Using the `Paw` class directly](#paw)\n- [Creating a custom logger via `PawInterface`](#pawinterface)\n\n### Paw\n\nThe `Paw` class offers a straightforward approach to logging in your project. Simply instantiate the `Paw` class and utilize its various methods for logging. Have a look at example below,\n\n```dart\n\nimport 'package:paw/paw.dart';\n\n///\n/// Create an instance of [paw] with custom configurations.\n///\nfinal paw = Paw(\n  // optional, defaults to [PAW]\n  title: \"MyApp\",\n\n  // optional, defaults to [true]\n  shouldIncludeSourceFileInfo: true,\n\n  // optional, defaults to [true]\n  shouldIncludeTitle: true,\n\n  // optional, defaults to [true]\n  shouldPrint: true,\n\n  // optional, defaults to [5]\n  stackTraceToPrint: 5,\n\n  // optional, defaults to [PawDarkTheme]\n  theme: PawDarkTheme(),\n\n  // Note: When the `level` is set to [null], Paw is allowed to print logs\n  // of all levels. To only print logs of a certain level, set the `level` to\n  // that specific level, e.g. [PawLogLevels.fetal] to only print fetal logs\n\n  level: null, // this allows paw to print all the logs, defaults to [null]\n);\n\n```\n\nFor more details on how to use `Paw` class, have a look at this [example](./example/main.dart).\n\n\u003e **👉 NOTE:** To maintain consistency and avoid redundancy, it's not recommended to create a new instance of `Paw` for every class or function. More details [here](#using-a-global-instance)\n\n### PawInterface\n\n`PawInterface` allows for more control over the logging process in Paw 🐾. You can implement your custom logger as fallows:\n\n```dart\n\nimport 'package:paw/paw.dart';\n\n///\n/// [MyLogger] is a custom logger class created with [PawInterface] to help\n/// enhance the functionality of Paw 🐾\n///\nclass MyLogger extends PawInterface {\n  ///\n  /// All the fields are optional, you can edit them according to your needs\n  ///\n  MyLogger({\n    super.name = \"MyApp\",\n    super.maxStackTraces = 5,\n    super.shouldIncludeSourceInfo = false,\n    super.shouldPrintLogs = true,\n    super.shouldPrintName = false,\n  }) : super(\n          currentTheme: PawDarkTheme(),\n        );\n\n  ///\n  /// You can override all the log levels to enhance their functionality\n  ///\n  @override\n  void info(String msg, {StackTrace? stackTrace}) {\n    super.info(msg, stackTrace: stackTrace);\n\n    // Optional: Additional functionality after logging.\n    print(\"Custom actions after logging info\");\n  }\n\n  //\n  // You can override any log level to enhance its functionality\n  //\n}\n\n```\n\nSimilar to using `Paw` class, you can use `MyLogger` in the same way. For more details, have a look at this\n[example](./example/custom_logger_example.dart).\n\n\u003e **👉 NOTE:** Try to create global variable to access `MyLogger` or convert `MyLogger` into a singleton to avoid redundancy. More details [here](#implementing-a-singleton-pawinterface)\n\n## Log Levels\n\nBelow are various logging levels provided by `Paw`,\n\n### `info`\n\nLog an informational message. Use this for general app flow information, which could be helpful for\nunderstanding the app's behavior.\n\n```dart\n\n///\n/// Log an informational message.\n///\n/// Use this for general app flow information, which could be helpful for\n/// understanding the app's behavior.\n///\npaw.info(\"This is an informational message\");\n\n```\n\n### `trace`\n\nLog a tracing message. Use this for tracking code flow and high-volume logs\n\n```dart\n\n///\n/// Log a tracing message\n///\n/// Use this for tracking code flow and high-volume logs\n///\npaw.trace(\"This is a trace log\");\n\n```\n\n### `warn`\n\nLog a warning message. Use this for non-critical issues that should be noted.\n\n```dart\n\n///\n/// Log a warning message.\n///\n/// Warn logs are useful for non-critical issues that should be\n/// brought to attention.\n///\npaw.warn(\"Be aware! This is a warning message\");\n\n```\n\n### `debug`\n\nLog a data object for debugging. Essential for troubleshooting and understanding complex data\nobjects in your code.\n\n```dart\n\n///\n/// Log a data object for debugging.\n///\n/// This is particularly useful for logging structured data, making it\n/// easier to understand complex data states.\n///\npaw.debug({'key': 'value', 'count': 42});\n\n```\n\n### `error`\n\nLog an error with additional context. Use this for logging exceptions or errors that occur in your application.\n\n```dart\n\n///\n/// Log an error with additional context.\n///\n/// Here you can pass a message, an error object for in-depth debugging.\n///\n/// Use this for logging exceptions or errors that occur in your application.\n///\ntry {\n  throw UnsupportedError(\"Oops! You've forgotten to implement this feature\");\n} catch (e) {\n  // Log an error with a message and error object\n  paw.error(\n    'An unexpected error occurred',\n    error: e,\n  );\n}\n\n```\n\n### `fetal`\n\nLog an error with additional context such as a message, an error object, and even a stack trace\nfor in-depth debugging. Use this for logging critical exceptions or errors that may break your application.\n\n```dart\n\n///\n/// Log an error with additional context.\n///\n/// Here you can pass a message, an error object, and even a stack trace\n/// for in-depth debugging.\n///\n/// Use this for logging exceptions or errors that occur in your application.\n///\ntry {\n  throw UnsupportedError(\"Oops! You've forgotten to implement this feature\");\n} catch (e, stackTrace) {\n  // Log a fetal log with a message, error object, and stack trace\n  paw.fetal(\n    'A very serious error occurred',\n    stackTrace: stackTrace,\n    error: e,\n  );\n}\n\n```\n\n## Themes\n\nTo increase accessability and readability of the logs, Paw 🐾 provides two themes out of the box,\n\n- [PawDarkTheme](#pawdarktheme)\n- [PawLightTheme](#pawlighttheme)\n\n### `PawDarkTheme`\n\n`PawDarkTheme` is suitable option when your device or code editor has a dark theme. Look at the\nexample below to use `PawDarkTheme`,\n\n```dart\n\nimport 'package:paw/paw.dart';\n\n///\n/// Create an instance of [Paw] with [PawDarkTheme]\n///\nfinal paw = Paw(\n  theme: PawDarkTheme(),\n);\n\n```\n\n![Paw Dark Theme](./assets/paw_dark_theme.png)\n\n### `PawLightTheme`\n\n`PawLightTheme` is suitable option when your device or code editor has a light theme. Look at the\nexample below to use `PawLightTheme`,\n\n```dart\n\nimport 'package:paw/paw.dart';\n\n///\n/// Create an instance of [Paw] with [PawLightTheme]\n///\nfinal paw = Paw(\n  theme: PawLightTheme(),\n);\n\n```\n\n![Paw Light Theme](./assets/paw_light_theme.png)\n\n## Custom Themes\n\nTo customise colors of the logs, you can create your own theme by using `PawCustomTheme` class.\n\nPaw provides various ANSI colors out of the box to help you create your themes, you can use `AnsiForegroundColors` and\n`AnsiBackgroundColor` respectively to create your themes. You can also bring your own colors to your theme by using the\navailable `custom` function on both of the colors classes.\n\nLook at the example below to create your own custom theme,\n\n```dart\n\nimport 'package:paw/paw.dart';\n\n///\n/// Custom theme created using [PawCustomTheme] to customise colors of the logs\n/// printed on the consol with [Paw]\n///\nfinal kCustomTheme = PawCustomTheme(\n  heading: AnsiForegroundColors.black,\n  message: AnsiForegroundColors.softPink,\n  object: AnsiForegroundColors.gray,\n  errorMessage: AnsiForegroundColors.orange,\n  errorObject: AnsiForegroundColors.red,\n  bgWarn: AnsiBackgroundColor.lightGray,\n  bgInfo: AnsiBackgroundColor.blue,\n  bgTrace: AnsiBackgroundColor.darkPink,\n  bgDebug: AnsiBackgroundColor.gray,\n  bgError: AnsiBackgroundColor.darkPink,\n  bgFetal: AnsiBackgroundColor.brown,\n  infoCardBg: AnsiBackgroundColor.custom(r: 204, g: 255, b: 153),\n);\n\n///\n/// Create an instance of [Paw] with [kCustomTheme]\n///\nfinal paw = Paw(\n  theme: kCustomTheme,\n);\n\n```\n\nFor more details on how to create and use your custom themes, have a look at this\n[example](./example/custom_theme_example.dart).\n\n## Efficient Usage Practices\n\nTo maintain consistency and avoid redundancy, it's not recommended to create a new instance of `Paw` for every class or function. Doing so can lead to issues with maintaining standard configurations throughout your application.\n\nFor instance, if you decide to change a configuration, like hiding _source file info_ or disabling _log printing_, modifying every `Paw` instance becomes impractical.\n\nTo address this, consider one of the following approaches:\n\n### Using a Global Instance\n\nCreating a global instance of `Paw` helps avoid the creation of multiple instances with varying configurations. This approach promotes consistency and ease of configuration management.\n\n```dart\n\nimport 'package:paw/paw.dart';\n\n///\n/// Create a global immutable / constant instance of [Paw] with custom configurations.\n///\nfinal kPaw = Paw(\n  // optional, defaults to [PAW]\n  title: \"MyApp\",\n\n  // optional, defaults to [true]\n  shouldIncludeSourceFileInfo: true,\n\n  // optional, defaults to [true]\n  shouldIncludeTitle: true,\n\n  // optional, defaults to [true]\n  shouldPrint: true,\n\n  // optional, defaults to [5]\n  stackTraceToPrint: 5,\n\n  // optional, defaults to [PawDarkTheme]\n  theme: PawDarkTheme(),\n\n  // Note: When the `level` is set to [null], Paw is allowed to print logs\n  // of all levels. To only print logs of a certain level, set the `level` to\n  // that specific level, e.g. [PawLogLevels.fetal] to only print fetal logs\n\n  level: null, // this allows paw to print all the logs, defaults to [null]\n);\n\n```\n\n### Implementing a Singleton PawInterface\n\nIf global variables don't align with your project's architecture, or you prefer a more encapsulated approach,\na singleton implementation of `PawInterface` is a viable alternative.\n\n```dart\nimport \"package:paw/paw.dart\";\n\n///\n/// Singleton [MyLogger] class.\n///\nclass MyLogger extends PawInterface {\n  // Private constructor to prevent external instantiation.\n  MyLogger._({\n    required super.name,\n    required super.maxStackTraces,\n    required super.shouldIncludeSourceInfo,\n    required super.shouldPrintLogs,\n    required super.shouldPrintName,\n    required super.theme,\n    required super.level,\n  });\n\n  // Static instance for external access.\n  static MyLogger? _instance;\n\n  // Public factory constructor.\n  factory MyLogger() {\n    // Initialize the instance if it hasn't been already.\n    _instance ??= MyLogger._(\n      name: \"MyApp\",\n      maxStackTraces: 5,\n      shouldIncludeSourceInfo: true,\n      shouldPrintLogs: true,\n      shouldPrintName: true,\n      theme: PawDarkTheme(),\n      level: null,\n    );\n\n    return _instance!;\n  }\n\n  @override\n  void info(String msg, {StackTrace? stackTrace}) {\n    super.info(msg, stackTrace: stackTrace);\n\n    // Optional: Additional functionality after logging.\n    print(\"Custom actions after logging info\");\n  }\n}\n```\n\n## Contributing\n\nWe welcome contributions! If you'd like to improve Paw 🐾, please open an issue or an PR with\nyour suggested changes in this [repo](https://github.com/AdityaMotale/paw). Happy Coding 🤝!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadityamotale%2Fpaw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadityamotale%2Fpaw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadityamotale%2Fpaw/lists"}