bunyando

BunyanDo - getLogger - log - resolveLevel - setSerializer - setFile - streamIs - validateStreams - formatStream - consoleLog - consoleLog - fileStream - rotatingFileStream - init

Usage no npm install needed!

<script type="module">
  import bunyando from 'https://cdn.skypack.dev/bunyando';
</script>

README

Table of Contents

BunyanDo

Extends LoggerITF

Extend Bunyan logger

getLogger

Return the current Bunyan logger

Returns any Bunyan Logger

log

Logs message

Parameters

resolveLevel

Validates input and returns formatted level

Parameters

Returns String Formatted level

setSerializer

Sets logger serializer to the defaults of the logger or overridden by input

Parameters

Returns any serializer functions

setFile

Review, format path/filename, and return valid path that is writable

Parameters

Returns any Usable path

streamIs

Reviews and IDs a stream

Parameters

  • stream JSON Valid stream format

Returns String Stream type

validateStreams

Validates a single or Array of streams and returns an array of valid streams. Replaces undefined with consoleLog stream.

Parameters

Returns Array Valid streams

formatStream

Evaluates the input stream and ensures that it meets the format needed

Parameters

  • stream JSON Object that provides defaults subject to this type of stream

Returns JSON

consoleLog

Creates stream object that supports this type of stream

Parameters

  • stream (undefined | JSON) Object that provides defaults subject to this type of stream

Returns JSON

consoleLog

Creates stream object that supports this type of stream

Parameters

  • stream (undefined | JSON) Object that provides defaults subject to this type of stream

Returns JSON

fileStream

Creates stream object that supports this type of stream

Parameters

  • stream (undefined | JSON) Object that provides defaults subject to this type of stream

Returns JSON

rotatingFileStream

Creates stream object that supports this type of stream

Parameters

  • stream (undefined | JSON) Object that provides defaults subject to this type of stream

Returns JSON

init

(Static) Intantiates and returns product without the need to "new"

Returns Class Instantiated class