@snailicid3/logger
v0.0.4
Published
Unified Node logger with chalk output and shell script counterpart
Maintainers
Readme
@snailicid3/logger 🐌
Unified Node.js logger with chalk-powered colored output.
Repository
- Github:
@snailicid3/logger•snailicid3
Author
👤 Gillian Tunney
Recommended package manager is pnpm
@snailicid3/logger 🐌
This package provides a structured Node.js logger with configurable chalk colors per log level. Log
levels include info, warn, error, debug, and trace. Colors can be specified as chalk color
names or hex strings.
@snailicid3/logger contains:
getLogger— create a logger instance with per-level color configuration- Log levels —
info,warn,error,debug,trace - Color support — chalk color names and hex color strings via
@snailicid3/color - Types —
LogLevelName,ChalkColor
Installation
#pnpm
$ pnpm add @snailicid3/logger
#yarn
$ yarn add @snailicid3/logger
#npm
$ npm install @snailicid3/loggerExamples
import { getLogger, parseHexColor } from '@snailicid3/logger'
const LOGGER = getLogger({
colors: {
info: 'greenBright',
warn: parseHexColor('#03fc0b'),
error: 'bgRedBright',
},
})
LOGGER.info('Hello, world!')
LOGGER.warn('This is a warning.')
LOGGER.error('This is an error.')
LOGGER.debug('This is a debug message.')
LOGGER.trace('This is a trace message.')