Styling and Colorful Logs in Browser Console | Logger.js

Styling-and-Colorful-Logs-in-Browser-Console-Logger

Logger.js is an ES6 JavaScript module that provides unified console output across Firefox and Chromium browsers. It handles standard bugs raised for example, with new bugs (), and is also capable of handling custom bugs to suit your application’s needs.

With ~ 3Kb mini, Logger.js is designed to be stable and stay as light as possible. It’s meant to be used at the application level to abstract this output layer into base calls.

How to make use of it:

1. Import the Logger as an ES module.

import Logger from ‘./src/Logger.js’;

2. Console logs will be raised from JavaScript errors (new Error()), or utilizing a customized error format, with a theme (info, error, warning, success), title, and message.

let MyLogger = new Logger({
    errors: {
      "SAMPLE_ERROR_1": {
        "title": "Error 1 title",
        "message": "Some justification. See log for details.",
        "severity": "error"
      },
      "SAMPLE_ERROR_2": {
        "title": "Error 2 title",
        "message": "Some justification. See log for details.",
        "severity": "warning"
      },
      "SAMPLE_ERROR_3": {
        "title": "Error 3 title",
        "message": "Some justification. See log for details.",
        "severity": "info"
      },
      "SAMPLE_ERROR_4": {
        "title": "Error 4 title",
        "message": "Some justification. See log for details.",
        "severity": "success"
      }
    }
});
MyLogger.raise('SAMPLE_ERROR_1');
MyLogger.raise('SAMPLE_ERROR_2');
MyLogger.raise('SAMPLE_ERROR_3');
MyLogger.raise('SAMPLE_ERROR_4');
MyLogger.raise(new Error('TypeError'));

Create Stylized Console Logs, Logger JS Plugin/Github


See Demo And Download

Official Website(ArthurBeaulieu): Click Here

This superior jQuery/javascript plugin is developed by ArthurBeaulieu. For extra Advanced usage, please go to the official website.

Share