Skip to Content
🎉 Hyperse Logger has been published.
Documentationlogger-plugin-console

Logger Console Plugin

This plugin is the official console output plugin for Hyperse Logger , designed to provide rich, customizable log output in both browser and Node.js environments. It supports colored output, timestamps, log levels, plugin and logger names, prefixes, arrow symbols, and more. With a wide range of configuration options, you can tailor the appearance and content of your console logs to fit your workflow, making it easier to debug and monitor your applications in real time.

Installation

npm install @hyperse/logger-plugin-console

Usage

// @filename: @hyperse/logger-plugin-console/dist/index.d.ts import { , , } from '@hyperse/logger-plugin-console'; import { , } from '@hyperse/logger'; const = ({ : 'hps-logger', : ., }) .(()) .(); .('info message');

Output

console output

API

createConsolePlugin

Parameters:
NameTypeDefault
optionsConsoleOptions

Optional configuration options for the plugin.

Returns:
LoggerPlugin<object>

A new logger plugin that outputs formatted log messages to the console.

ConsoleOptions

NameTypeDefault
disableboolean

If true, the plugin will be disabled

false
showLoggerNameboolean

If true, the logger name will be shown

false
capitalizeLoggerNameboolean

If true, the logger name will be capitalized

false
showPluginNameboolean

If true, the plugin name will be shown

false
capitalizePluginNameboolean

If true, the plugin name will be capitalized

false
showPrefixboolean

If true, the prefix will be shown

true
showLevelNameboolean

If true, each message logged to the terminal will have the name of the level of the message attached to it.

[ FATAL ] WHAT WILL I DO?!

true
capitalizeLevelNameboolean

If true, the level name will be capitalized

true
showDateboolean

If true, each message logged to the terminal will have a date corresponding to when the message was logged attached to it.

[ 2025-7-1 ] foo

false
showTimestampboolean

If true, each message logged to the terminal will have a timestamp corresponding to the exact time the message was logged.

[ 13:43:10.23 ] bar

true
use24HourClockboolean

If true, the timestamp on each message logged to the console will be displayed using the 24 hour clock instead of the 12 hour clock. Keep in mind that the timestamp of when a log was logged to the console is only displayed when showTimestamp is also true.

24 hour clock:

[ 13:27:55.33 ] pow

12 hour clock:

[ 1:27:55.33 PM ] pow

true
showArrowboolean

Whether or not to show a cool arrow before a log’s message.

>> baz

false
noColorboolean

Removes colors from the console output

false
levelColor{ 0?: string; 1?: string; 2?: string; 3?: string; 4?: string; }

The color of the level of the message

{ [LogLevel.Error]: 'color:red;', [LogLevel.Warn]: 'color:yellow;', [LogLevel.Info]: 'color:blue;', [LogLevel.Debug]: 'color:magenta;', [LogLevel.Verbose]: 'color:magenta;', }
prefixColorstring

The color of the context

'color: magenta; font-weight: bold;'
loggerNameColorstring

The color of the context

'color: cyan; font-weight: bold;'
pluginNameColorstring

The color of the context

'color: cyan; font-weight: bold;'
Last updated on