New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@jf/logger

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jf/logger

Class for manipulating logs and traces. Can be used as base class for reporting class or node scripts.

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

jfLogger stable

Class for manipulating logs and traces.

Can be used as base class for reporting class or node scripts.

Extend jfObject inheriting all its features and functionalities.

Use jfTranslations so messages can be translated in other languages.

Usage

npm install jfLogger

Example

const jfLogger = require('jf-logger');
jfLogger.translations.addLanguage('en');
// Using new
const logger = new jfLogger();
// As singleton
const logger = jfLogger.i();
logger.log( // 12:34:56 [jfLogger  ] You must set field `name`
    'warn', 
    '', // If empty, class name is used.
    'Debes asignar el campo `%s`',
    'name'
);
logger.log( // 12:34:56 Min length for `Description` is 10 chars.
    'warn', 
    false, // If false, name is hidden.
    'La longitud mínima para `{name}` es {minLength}',
    {
        name      : 'Description',
        minLength : 10
    }
);

Removing/changing colors

If you want differents colors or not colors at all you can overwrite addColorsToLogParams.

If you use an empty function you will remove all colors in parameters.

Keywords

log

FAQs

Package last updated on 11 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts