1.0.0 • Published 6 years ago

jf-logger v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

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.

1.0.0

6 years ago

0.2.0

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago