1.2.1 • Published 2 years ago

easy-c-loggr v1.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

easy-c-loggr

An easy-to-use tool to create beautiful and consistant console logs within seconds.

Getting started

  1. Install the package
  npm install easy-c-loggr
  1. Add the configuration (JavaScript)
const Logger = require('easy-c-loggr').default;
const logger = new Logger({ formattedDate: true, formatLanguage: 'EN' });
/*
 * new Logger({ TIMESTAMP_IS_FORMATTED, FORMAT_LANGUAGE })
 * by default, timestamp formation is disabled, with 'true' you enable it and can choose the language
 * currently available languages: EN, DE
 */
  1. Add the configuration (TypeScript)
import Logger from 'easy-c-loggr';
const logger = new Logger({ formattedDate: true, formatLanguage: 'EN' });
/*
 * new Logger(TIMESTAMP_IS_FORMATTED, FORMAT_LANGUAGE)
 * by default, timestamp formation is disabled, with 'true' you enable it and can choose the language
 * currently available languages: EN, DE
 */
  1. Use the package
logger.error('Error message'); // Red error message
logger.hint('Hint message'); // Blue hint message
logger.log('Log message'); // White log message
logger.success('Success message'); // Green success message
logger.warn('Warn message'); // Yellow warn message

Advanced configuration

logger.setPrefixes({ error: 'ERROR:', log: 'LOG:', hint: 'HINT:', success: 'OK', warn: 'WARN:' });
/*
* The setPrefixes method sets prefixes for the default functions that get added before EVERY log message.
*/
logger.error('404 Not found'); // Console output: [Timestamp] ERROR: 404 Not found

Coming soon

  • Custom colors
  • More configuration options

Developer

MarcDev

1.2.1

2 years ago

1.2.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago