Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@xylabs/logger

Package Overview
Dependencies
Maintainers
5
Versions
444
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xylabs/logger

XYLabs Logger Library

Source
npmnpm
Version
5.1.5
Version published
Weekly downloads
5.6K
-75.69%
Maintainers
5
Weekly downloads
 
Created
Source

@xylabs/logger

npm license

XYLabs Logger Library

Install

Using npm:

npm install {{name}}

Using yarn:

yarn add {{name}}

Using pnpm:

pnpm add {{name}}

Using bun:

bun add {{name}}

License

See the LICENSE file for license rights and limitations (LGPL-3.0-only).

Reference

packages

logger

### .temp-typedoc

  ### classes

    ### <a id="ConsoleLogger"></a>ConsoleLogger

@xylabs/logger

A LevelLogger that delegates to the global console object.

Extends

  • LevelLogger

Constructors

Constructor

new ConsoleLogger(level?): ConsoleLogger;

Parameters

level?

LogLevelValue = LogLevel.warn

Returns

ConsoleLogger

Overrides

LevelLogger.constructor

Properties

level

readonly level: LogLevelValue;

Inherited from

LevelLogger.level

logger

readonly logger: Logger;

Inherited from

LevelLogger.logger

Accessors

debug

Get Signature

get debug(): LogFunction;

Returns

LogFunction

Inherited from

LevelLogger.debug

error

Get Signature

get error(): LogFunction;

Returns

LogFunction

Inherited from

LevelLogger.error

info

Get Signature

get info(): LogFunction;

Returns

LogFunction

Inherited from

LevelLogger.info

log

Get Signature

get log(): LogFunction;

Returns

LogFunction

Inherited from

LevelLogger.log

trace

Get Signature

get trace(): LogFunction;

Returns

LogFunction

Inherited from

LevelLogger.trace

warn

Get Signature

get warn(): LogFunction;

Returns

LogFunction

Inherited from

LevelLogger.warn

    ### <a id="IdLogger"></a>IdLogger

@xylabs/logger

A logger wrapper that prefixes every log message with a bracketed identifier. Useful for distinguishing log output from different components or instances.

Implements

Constructors

Constructor

new IdLogger(logger, id?): IdLogger;

Parameters

logger

Logger

id?

() => string

Returns

IdLogger

Accessors

id

Set Signature

set id(id): void;

Parameters

id

string

Returns

void

Methods

debug()

debug(...data): void;

Parameters

data

...unknown[]

Returns

void

Implementation of

Logger.debug

error()

error(...data): void;

Parameters

data

...unknown[]

Returns

void

Implementation of

Logger.error

info()

info(...data): void;

Parameters

data

...unknown[]

Returns

void

Implementation of

Logger.info

log()

log(...data): void;

Parameters

data

...unknown[]

Returns

void

Implementation of

Logger.log

trace()

trace(...data): void;

Parameters

data

...unknown[]

Returns

void

Implementation of

Logger.trace

warn()

warn(...data): void;

Parameters

data

...unknown[]

Returns

void

Implementation of

Logger.warn
    ### <a id="LevelLogger"></a>LevelLogger

@xylabs/logger

A logger that filters messages based on a configured log level. Methods for levels above the configured threshold return a no-op function.

Extended by

Implements

Constructors

Constructor

new LevelLogger(logger, level?): LevelLogger;

Parameters

logger

Logger

level?

LogLevelValue = LogLevel.warn

Returns

LevelLogger

Properties

level

readonly level: LogLevelValue;

logger

readonly logger: Logger;

Accessors

debug

Get Signature

get debug(): LogFunction;

Returns

LogFunction

Implementation of

Logger.debug

error

Get Signature

get error(): LogFunction;

Returns

LogFunction

Implementation of

Logger.error

info

Get Signature

get info(): LogFunction;

Returns

LogFunction

Implementation of

Logger.info

log

Get Signature

get log(): LogFunction;

Returns

LogFunction

Implementation of

Logger.log

trace

Get Signature

get trace(): LogFunction;

Returns

LogFunction

Implementation of

Logger.trace

warn

Get Signature

get warn(): LogFunction;

Returns

LogFunction

Implementation of

Logger.warn

    ### <a id="SilentLogger"></a>SilentLogger

@xylabs/logger

A logger that does not log anything. This is useful when you want to disable logging like when running unit tests or in silent mode. It implements the Logger interface but all methods are no-op functions.

Implements

Constructors

Constructor

new SilentLogger(): SilentLogger;

Returns

SilentLogger

Properties

debug

readonly debug: (..._data) => undefined = NoOpLogFunction;

A log function that silently discards all arguments.

Parameters

_data

...unknown[]

Returns

undefined

Implementation of

Logger.debug

error

readonly error: (..._data) => undefined = NoOpLogFunction;

A log function that silently discards all arguments.

Parameters

_data

...unknown[]

Returns

undefined

Implementation of

Logger.error

info

readonly info: (..._data) => undefined = NoOpLogFunction;

A log function that silently discards all arguments.

Parameters

_data

...unknown[]

Returns

undefined

Implementation of

Logger.info

log

readonly log: (..._data) => undefined = NoOpLogFunction;

A log function that silently discards all arguments.

Parameters

_data

...unknown[]

Returns

undefined

Implementation of

Logger.log

trace

readonly trace: (..._data) => undefined = NoOpLogFunction;

A log function that silently discards all arguments.

Parameters

_data

...unknown[]

Returns

undefined

Implementation of

Logger.trace

warn

readonly warn: (..._data) => undefined = NoOpLogFunction;

A log function that silently discards all arguments.

Parameters

_data

...unknown[]

Returns

undefined

Implementation of

Logger.warn

  ### functions

    ### <a id="NoOpLogFunction"></a>NoOpLogFunction

@xylabs/logger

function NoOpLogFunction(..._data): undefined;

A log function that silently discards all arguments.

Parameters

_data

...unknown[]

Returns

undefined

    ### <a id="getFunctionName"></a>getFunctionName

@xylabs/logger

function getFunctionName(depth?): string;

Retrieves the name of the calling function by inspecting the stack trace.

Parameters

depth?

number = 2

The stack frame depth to inspect (default: 2, the caller's caller).

Returns

string

The function name, or '' if it cannot be determined.

  ### interfaces

    ### <a id="Logger"></a>Logger

@xylabs/logger

Interface to handle overlap between Winston & console with as much congruency as possible.

Properties

debug

debug: LogFunction;

error

error: LogFunction;

info

info: LogFunction;

log

log: LogFunction;

trace

trace: LogFunction;

warn

warn: LogFunction;
  ### type-aliases

    ### <a id="LogFunction"></a>LogFunction

@xylabs/logger

type LogFunction = (...data) => void;

A generic logging function that accepts any number of arguments.

Parameters

data

...unknown[]

Returns

void

    ### <a id="LogLevelKey"></a>LogLevelKey

@xylabs/logger

type LogLevelKey = EnumKey<typeof LogLevel>;

String key for a log level (e.g. 'error', 'warn', 'info').

    ### <a id="LogLevelValue"></a>LogLevelValue

@xylabs/logger

type LogLevelValue = EnumValue<typeof LogLevel>;

Numeric value of a log level (1 through 6).

    ### <a id="LogVerbosity"></a>LogVerbosity

@xylabs/logger

type LogVerbosity = LogLevelKey;

Alias for LogLevelKey, representing the verbosity setting as a string.

  ### variables

    ### <a id="LogLevel"></a>LogLevel

@xylabs/logger

const LogLevel: Enum<{
  error: 1;
  warn: 2;
  info: 3;
  log: 4;
  debug: 5;
  trace: 6;
}>;

Numeric log level values, from least verbose (error=1) to most verbose (trace=6).

Keywords

logger

FAQs

Package last updated on 18 May 2026

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