Giter Site home page Giter Site logo

hemend_logger's Introduction

Hemend Logger

License: MIT pub package git repo pub points code size code_count Tests codecov

Simple Logging Manager that extends Logging package to manage logging system.

AnsiLogger

Screencast.from.06-01-2023.11.49.16.AM.webm

Installation ๐Ÿ’ป

โ— In order to start using Hemend Logger you must have the Dart SDK installed on your machine.

Add hemend_logger to your pubspec.yaml:

dependencies:
  hemend_logger: <latest-version>

Install it:

dart pub get

Usage

This software package incorporates the logging package as its default logging mechanism, providing the fundamental logging functionality. However, users are afforded the opportunity to augment and enhance this logging system by integrating their own customized logging system or methods.

The present package incorporates an AnsiLogger as its intrinsic logging utility, which effectively facilitates the printing of logs within a terminal environment. However, it possesses the inherent flexibility to be extended in order to engender diverse logging capabilities. For instance, it can be augmented to support online log recording, allowing for the persistent storage of log data. Additionally, it can be further enhanced to provide in-app interactive logging systems, enabling the utilization of toast messages or similar mechanisms for conveying log information within the application interface.

To enhance the functionality of this package, you can use extension packages such as:

  • hemend_async_log_recorder:
  • Enables asynchronous logging, including options for file logging, websocket, and HTTP requests.
  • Supports Isolated logging, which helps keep your application running smoothly even under high load when using multiple log recorders like file logger, Sentry logger, ANSI logger, and websocket logger.
  • hemend_sentry_log_recorder:
    • A simple log recorder for Sentry instance.

Initiation

For optimal usage, it is recommended to employ the default configuration offered by [HemendLogger]. By doing so, you can readily utilize the predefined settings and specifications without any additional customization.

HemendLogger.defaultLogger()

To modify the logger level of the application at the main method, utilize the Logger.root.level = <Level> option prior to initializing the [HemendLogger]. This approach allows you to adjust the logging verbosity and control the amount of log information generated by the application.

To enable hierarchical logging functionality, it is essential to ensure that the hierarchicalLoggingEnabled variable is set to true. This variable, which is provided by the logging package, allows for the proper functioning of the hierarchical logging system. By enabling this variable, you enable the hierarchical structure that enables more granular control and organization of loggers and log levels.

For the utilization of custom logging capabilities, please refer to the relevant documentation provided within the package.

Accessibility

As the default implementation of this package is primarily a wrapper around the default Logger provided by the logging package, its main contribution lies in the provision of a useful mixin. This mixin can be applied to classes, thereby granting them access to additional logging functionalities. By incorporating this mixin, classes can seamlessly integrate logging capabilities into their implementation, enhancing their logging capabilities and facilitating the generation of informative log messages.

class Example with LogableObject{
  @override
  String get loggerName => 'ExampleObject';
}

Alternatively, you can directly utilize the default Logger class provided by the logging package, without relying on any additional mixins or custom implementations. The default Logger class offers a comprehensive set of logging functionalities that can be accessed and utilized directly in your code. By utilizing the default Logger, you can leverage the capabilities provided by the logging package in a straightforward manner, without the need for any additional extensions or mixins.


Continuous Integration ๐Ÿค–

Hemend Logger comes with a built-in GitHub Actions workflow powered by Very Good Workflows but you can also add your preferred CI/CD solution.

Out of the box, on each pull request and push, the CI formats, lints, and tests the code. This ensures the code remains consistent and behaves correctly as you add functionality or make changes. The project uses Very Good Analysis for a strict set of analysis options used by our team. Code coverage is enforced using the Very Good Workflows.


hemend_logger's People

Contributors

dependabot[bot] avatar fmotalleb avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.