Socket
Book a DemoInstallSign in
Socket

consoloo

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

consoloo

colorful logger for nodejs and browser

2.1.0
latest
Source
npmnpm
Version published
Weekly downloads
97
-30.71%
Maintainers
1
Weekly downloads
 
Created
Source

consoloo

customable colorful logger for nodejs and browser

install

npm install consoloo
yarn add consoloo
pnpm add consoloo

usage

import { createFileReporter, createNodeLogger } from 'consoloo'
import { createBrowserLogger } from 'consoloo/browser'
import { createBaseLogger } from 'consoloo/core'

// basic
const logger = createBaseLogger()

// node
const node = createNodeLogger()
const stop = node.timer('log timer')
node.info('info')
node.warn('warn')
node.error('error')
node.setLogMode('debug')
node.withScope('with').debug('test withScope')
node.info('test inline scope', 'inline')
const scopeLogger = node.withScope('foo')
scopeLogger.warn('test change scope')

const fileLogger = createNodeLogger<'file' | 'test'>({
  logMode: 'debug',
  reporter: [createFileReporter({ logDir: './logs' })],
})
fileLogger.debug('info', 'file') // typesafe scope
try {
  throw new Error('test error in file')
} catch (error) {
  fileLogger.error('test error in file', error)
}
stop()

// browser
const browserLogger = createBrowserLogger('debug')

logMode

  • 'debug': debug, info, warn, error
  • 'info': info, warn, error
  • 'error': error
  • 'disable': none

Keywords

console

FAQs

Package last updated on 11 Aug 2025

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.