2.2.0 • Published 1 year ago

@jordbaer/logging v2.2.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

const log = require("@jordbaer/logging");

log(prefix fmt ,args...);

fmt: format string for util.format()
args: arguments for util.format()

prefix:
	can be any value other than a string or an instance of String
	if prefix is a function, this function is called to get the prefix
	if prefix is an instanceof net.Server, the local socket address is the prefix
	if prefix or prefix.socket or prefix._socket is an instance of net.Socket, the remote socket address is the prefix

log.stamp(date);

returns timestamp "YYYY-MM-DD hh:mm:ss.sss"

log.addListener(callback);

synchronous output via callback(stamp,seq,line)

log.addListener(stream ,encoding);

asynchronous output via instance of stream.Writable

if no listener is added, synchronous output is via console.error()

log.flushWait(stream)

returns Promise which is resolved, when all output is written
2.2.0

1 year ago

2.0.3

3 years ago

2.0.2

3 years ago

2.1.0

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.1.0

3 years ago

1.0.3

3 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago