2.0.3-alpha.0 • Published 11 months ago

@empathyco/x-logger v2.0.3-alpha.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
11 months ago

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
2.0.3-alpha.0

11 months ago

2.0.2

12 months ago

2.0.1-alpha.0

1 year ago

2.0.2-alpha.0

12 months ago

2.0.0

1 year ago

2.0.0-alpha.6

1 year ago

1.2.0-alpha.8

2 years ago

1.2.0-alpha.9

2 years ago

2.0.0-alpha.3

1 year ago

2.0.0-alpha.4

1 year ago

2.0.0-alpha.5

1 year ago

2.0.0-alpha.0

1 year ago

2.0.0-alpha.1

1 year ago

2.0.0-alpha.2

1 year ago

1.2.0-alpha.10

2 years ago

1.2.0-alpha.11

2 years ago

1.2.0-alpha.6

2 years ago

1.2.0-alpha.7

2 years ago

1.2.0-alpha.5

2 years ago

1.2.0-alpha.4

2 years ago

1.2.0-alpha.3

3 years ago

1.2.0-alpha.2

3 years ago

1.2.0-alpha.1

3 years ago

1.2.0-alpha.0

3 years ago

1.1.2-alpha.8

3 years ago

1.1.2-alpha.7

3 years ago

1.1.2-alpha.6

3 years ago

1.1.2-alpha.5

3 years ago

1.1.2-alpha.4

3 years ago

1.1.2-alpha.3

3 years ago

1.1.2-alpha.2

3 years ago

1.1.2-alpha.1

3 years ago

1.1.2-alpha.0

3 years ago

1.1.1

3 years ago