Socket
Socket
Sign inDemoInstall

@empathyco/x-logger

Package Overview
Dependencies
1
Maintainers
5
Versions
34
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @empathyco/x-logger

Empathy simple logger


Version published
Weekly downloads
858
increased by15.63%
Maintainers
5
Install size
117 kB
Created
Weekly downloads
 

Readme

Source

X Logger

This project is a simple logger

Installation

To install the logger:

# or pnpm or yarn
npm install @empathyco/x-logger --save-dev

Usage

import { logger, LogLevel } from '@empathyco/x-logger';

There are different log levels to be set in the console level and server level.

enum LogLevel {
  silent = 0,
  error = 1,
  warn = 2,
  info = 3,
  debug = 4,
  trace = 5
}

And different methods to be called to use the logger:

logger.error()
logger.warn()
logger.info()
logger.debug()
logger.trace()

Depending on the LogLevel, only some levels will be displayed in the console. Setting the LogLevel to warn, the console will display the levels below it and itself, in this case, error and warn.

logger.consoleLevel = LogLevel.warn;
logger.serverLevel = LogLevel.silent;

logger.error() // console.error called
logger.warn() // console.warn called
logger.info() // console.info not called
logger.debug() // console.debug  not called
logger.trace() // console.trace not called

Keywords

FAQs

Last updated on 29 Nov 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc