Code Monkey home page Code Monkey logo

custom-logger's Introduction

Custom Logger Library

The Custom Logger Library provides flexible logging functionalities for Dart applications, enabling customized console output with enhanced formatting and color-coded messages.

Features

  • Color Formatting: Customize log messages with various colors for improved readability.
  • Log Level Configuration: Set different log levels and prefixes for information, errors, warnings, and successes.
  • Customizable Output: Define total line lengths, characters for filling, dividers, and more for tailored log formatting.

Installation

Add the following line to your pubspec.yaml:

dependencies:
  custom_logger: ^1.0.0  # Replace with the latest version

Then, run:

$ flutter pub get

Usage

Import the library:

import 'package:custom_logger/custom_logger.dart';

Initialize the logger:

final logger = CustomLogger.instance;

Customize logging options:

CustomLogger.setInfoPrefixAndSuffix('ℹ️');
CustomLogger.setErrorPrefixAndSuffix('❌');

Use the logger:

CustomLogger.info('This is an information message');
CustomLogger.error('This is an error message');
CustomLogger.success('This is a success message');
CustomLogger.warning('This is a warning message');

Configuration Options

The library provides several configuration options, including:

  • setInfoPrefixAndSuffix
  • setErrorPrefixAndSuffix
  • setSuccessPrefixAndSuffix
  • setWarningPrefixAndSuffix
  • setLineBreaksAfterLog
  • toggleCallerInfo
  • setInfoTitle
  • setErrorTitle
  • setSuccessTitle
  • setWarningTitle
  • and more...

Check the API documentation for detailed information on available methods and their usage.

Examples

For more advanced usage and specific scenarios, refer to the examples provided in the /example directory.

Issues and Feedback

Please report any issues or provide feedback on the GitHub repository.

License

This project is licensed under the MIT License.

custom-logger's People

Contributors

lfebruary avatar

Watchers

 avatar

Forkers

fossabot

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.