Socket
Book a DemoInstallSign in
Socket

easy-c-loggr

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

easy-c-loggr

An easy-to-use package to create beautiful console logs within seconds.

latest
Source
npmnpm
Version
1.2.1
Version published
Weekly downloads
6
Maintainers
1
Weekly downloads
 
Created
Source

easy-c-loggr

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

Getting started

  • Install the package
  npm install easy-c-loggr
  • 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
 */
  • 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
 */
  • 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

Keywords

console

FAQs

Package last updated on 28 May 2022

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.