Log

API ReferenceLog

Access it with:

const { log } = Neft;

Source


log.LOG

Static property of
log
Type
Integer

log.INFO

Static property of
log
Type
Integer

log.OK

Static property of
log
Type
Integer

log.WARN

Static property of
log
Type
Integer

log.ERROR

Static property of
log
Type
Integer

log.TIME

Static property of
log
Type
Integer

log.ALL

Static property of
log
Type
Integer

Source


enabled

Type
Integer
Default
log.ALL

Bitmask of the log.LOG, INFO, OK, WARN, ERROR and TIME.

Source


log()

Parameters
  • messages... — Anyoptional

Prints the given messages into the console.

log("Log me now!");

log("setName()", "db time");
// will be logged as "setName() → db time"

Source


log.info()

Static method of
log
Parameters
  • messages... — Anyoptional

Prints the given messages into the console with a blue color.

Source


log.ok()

Static method of
log
Parameters
  • messages... — Anyoptional

Prints the given messages into the console with a green color.

log.ok("Data has been successfully sent!");

Source


log.warn()

Static method of
log
Parameters
  • messages... — Anyoptional

Prints the given messages into the console with a yellow color.

log.warn("Example warning with some recommendations");

Source


log.error()

Static method of
log
Parameters
  • messages... — Anyoptional

Prints the given messages into the console with a red color.

log.error("Error occurs, ... in file ...");

Source


log.time()

Static method of
log
Returns
Array

Returns an id used to measure execution time by the log.end() function.

function findPath(){
  var logtime = log.time('findPath()');

  // ... some complex algorithm ...

  log.end(logtime);
}

findPath();

Source


log.end()

Static method of
log
Parameters
  • logTime — Array

Prints an information about the execution time for the given timer id.

Source


log.scope()

Static method of
log
Parameters
  • names... — Anyoptional

Returns a new log function.

All prints will be prefixed by the given names.

var log = log.scope("Example file");

log("hello");
// "Example file → hello"

Source

results matching ""

    No results matching ""