Class: PyxLog

PyxLog

Simple and pretty logging

new PyxLog()

/home/atirado/dev/private-npm/o-pyx-log/index.js, line 8
Example
const me = require('pyx-me').create('MyLog');

Members

private_modenumber

Mode of logger. Determines if logger is silent or not.
Default Value:
  • 1

private_namestring

Name of the logger instance.

private_prettyNamestring

The name of the logger wrapped with chalk.

Methods

staticPyxLog.create(name){PyxLog}

/home/atirado/dev/private-npm/o-pyx-log/index.js, line 146
Static instance generator. Creates a new instance of the PyxLog logger.
Name Type Description
name string Name of the logger.
Returns:
Type Description
PyxLog

private_runThisInMode(actionCb)

/home/atirado/dev/private-npm/o-pyx-log/index.js, line 132
Runs an action based on _mode
Name Type Description
actionCb function Function that will be called if on normal _mode (1)
See:
  • _mode

alert(msg)

/home/atirado/dev/private-npm/o-pyx-log/index.js, line 120
Outputs alert me messages. Good for errors or warnings. #note: Passed through the _runThisInMode method
Name Type Description
msg string String that will be embedded in the alert

beNormal()

/home/atirado/dev/private-npm/o-pyx-log/index.js, line 54
This is the default state of the logger; This will set the logger back to normal _mode if it was originally put to silent _mode by calling beSilent

beSilent()

/home/atirado/dev/private-npm/o-pyx-log/index.js, line 43
This silences the logger; once this method is called, no more output will be coming from the logger until beNormal is called or the debug option is enabled

debug(msg)

/home/atirado/dev/private-npm/o-pyx-log/index.js, line 100
Outputs debug me messages. Good for debugging of code while coding or as extra me information to debug reoccurring bugs. #note: This method only prints out if the `DEBUG_MODE` env variable is set and ignores _mode
Name Type Description
msg * repeatable Array of values (string or other) that will be printed out on the screen
/home/atirado/dev/private-npm/o-pyx-log/index.js, line 65
Outputs a header me including the name of the logger. Good for breaks in logic or initializing messages. #note: Passed through the _runThisInMode method
Name Type Description
msg string String that will be embedded in the header

log(msg)

/home/atirado/dev/private-npm/o-pyx-log/index.js, line 78
Outputs regular me messages. Good for data logs or simple messages. #note: Passed through the _runThisInMode method
Name Type Description
msg * repeatable Array of values (string or other) that will be printed out on the screen