
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
@evokegroup/console-logger
Advanced tools
Logs timestamped messages to the console.
const ConsoleLogger = require('@evokegroup/console-logger');
ConsoleLogger.log('Log this message');
// Expected result: [HH:mm:ss] Log this message
| Name | Description |
|---|---|
| Background | Background colors |
| Background.Black | |
| Background.Blue | |
| Background.Cyan | |
| Background.Gray | |
| Background.Green | |
| Background.Magenta | |
| Background.Red | |
| Background.White | |
| Background.Yellow | |
| Background.BrightBlue | |
| Background.BrightCyan | |
| Background.BrightGreen | |
| Background.BrightMagenta | |
| Background.BrightRed | |
| Background.BrightWhite | |
| Background.BrightYellow | |
| Foreground | Foreground colors |
| Foreground.Black | |
| Foreground.Blue | |
| Foreground.Cyan | |
| Foreground.Gray | |
| Foreground.Green | |
| Foreground.Magenta | |
| Foreground.Red | |
| Foreground.White | |
| Foreground.Yellow | |
| Foreground.BrightBlue | |
| Foreground.BrightCyan | |
| Foreground.BrightGreen | |
| Foreground.BrightMagenta | |
| Foreground.BrightRed | |
| Foreground.BrightWhite | |
| Foreground.BrightYellow | |
| Inverse | Inverse of default style |
| Reset | Resets to default style |
| Underscore | Underscores the text |
Enable or disabled styles globally.
Enable or disabled timestamps globally.
Set timestamp style globally.
Logs a message with given styles.
const ConsoleLogger = require('@evokegroup/console-logger');
ConsoleLogger.log('Log this message');
ConsoleLogger.log('Another message in blue', ConsoleLogger.Style.Foreground.Blue);
ConsoleLogger.log('Underscored in green with no timestamp', [ConsoleLogger.Style.Foreground.Green, ConsoleLogger.Style.Underscore], false);
ConsoleLogger.log([
new ConsoleLogger.MessagePart('red', ConsoleLogger.Style.Foreground.Red),
new ConsoleLogger.MessagePart(' green', ConsoleLogger.Style.Foreground.Green)
]);
| Name | Type | Default | Description |
|---|---|---|---|
| message | Array<ConsoleLogger.MessagePart>, ConsoleLogger.MessagePart, string | The message to be logged | |
| styles | Array<ConsoleLogger.Style>, ConsoleLogger.Style | The style of the message | |
| timestamp | boolean | true | Print a timestamp |
Logs a message in red.
const ConsoleLogger = require('@evokegroup/console-logger');
ConsoleLogger.error('error');
Logs a message in cyan.
const ConsoleLogger = require('@evokegroup/console-logger');
ConsoleLogger.info('info');
Logs a message in yellow.
const ConsoleLogger = require('@evokegroup/console-logger');
ConsoleLogger.warn('warn');
ConsoleLogger.log([
new ConsoleLogger.MessagePart('red', ConsoleLogger.Style.Foreground.Red),
new ConsoleLogger.MessagePart(' green', ConsoleLogger.Style.Foreground.Green)
]);
| Name | Type | Description |
|---|---|---|
| text | string | The text to log |
| styles | Array<ConsoleLogger.Style>, ConsoleLogger.Style | The style to apply to the text |
FAQs
Logs timestamped messages to the console.
We found that @evokegroup/console-logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

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.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.