Skip to main content

Interface: Logger

Defined in: packages/cspell-lib/src/lib/util/logger.ts:4

Properties

error()

error: {(...data): void; (message?, ...optionalParams): void; }

Defined in: packages/cspell-lib/src/lib/util/logger.ts:7

Call Signature

(...data): void

MDN Reference

Parameters
data

...any[]

Returns

void

Call Signature

(message?, ...optionalParams?): void

Prints to stderr with newline. Multiple arguments can be passed, with the first used as the primary message and all additional used as substitution values similar to printf(3) (the arguments are all passed to util.format()).

const code = 5;
console.error('error #%d', code);
// Prints: error #5, to stderr
console.error('error', code);
// Prints: error 5, to stderr

If formatting elements (e.g. %d) are not found in the first string then util.inspect() is called on each argument and the resulting string values are concatenated. See util.format() for more information.

Parameters
message?

any

optionalParams?

...any[]

Returns

void

Since

v0.1.100


log()

log: {(...data): void; (message?, ...optionalParams): void; }

Defined in: packages/cspell-lib/src/lib/util/logger.ts:5

Call Signature

(...data): void

MDN Reference

Parameters
data

...any[]

Returns

void

Call Signature

(message?, ...optionalParams?): void

Prints to stdout with newline. Multiple arguments can be passed, with the first used as the primary message and all additional used as substitution values similar to printf(3) (the arguments are all passed to util.format()).

const count = 5;
console.log('count: %d', count);
// Prints: count: 5, to stdout
console.log('count:', count);
// Prints: count: 5, to stdout

See util.format() for more information.

Parameters
message?

any

optionalParams?

...any[]

Returns

void

Since

v0.1.100


warn()

warn: {(...data): void; (message?, ...optionalParams): void; }

Defined in: packages/cspell-lib/src/lib/util/logger.ts:6

Call Signature

(...data): void

MDN Reference

Parameters
data

...any[]

Returns

void

Call Signature

(message?, ...optionalParams?): void

The console.warn() function is an alias for error.

Parameters
message?

any

optionalParams?

...any[]

Returns

void

Since

v0.1.100