Home Reference Source Repository
import $LogProvider from 'angie-log/src/services/$LogProvider.js'
public class | since 0.0.2 | source

$LogProvider

You can directly use instance of this class. $LogProvider

$LogProvider is the only class in the Angie Logging module. This module allows for logging to the terminal (with a little flavor).

This can also be referenced as Log

Example:

new $LogProvider();

Static Method Summary

Static Public Methods
public static

A wrapper for DEBUG output

since 0.0.2
public static

A wrapper for ERROR output

since 0.0.2
public static

info(s: string)

A wrapper for INFO output

since 0.0.2
public static

warn(s: string)

A wrapper for WARN output

since 0.0.2

Constructor Summary

Public Constructor
public

constructor(outfile: string | object, name: string, timestamp: boolean, level: string, silent: boolean)

Instantiate a logger for use in the current module.

since 0.0.2

Member Summary

Public Members
public
public

$$level: *

public

$$name: *

public
public
public

Method Summary

Public Methods
public

debug(): *

Logs a debug message to an outfile and to the terminal (unless otherwise specified).

since 0.9.7
public

error(): *

Logs an error to an outfile and to the terminal (unless otherwise specified).

since 0.9.7
public

info(): *

Logs info to an outfile and to the terminal (unless otherwise specified)

since 0.9.7
public

warn(): *

Logs a warning to an outfile and to the terminal (unless otherwise specified).

since 0.9.7

Static Public Methods

public static debug(s: string) since 0.0.2 source

A wrapper for DEBUG output

Params:

NameTypeAttributeDescription
s string

One or many string inputs

Example:

new $LogProvider.debug('test');

public static error(s: string) since 0.0.2 source

A wrapper for ERROR output

Params:

NameTypeAttributeDescription
s string

One or many string inputs

Example:

new $LogProvider.error('test');

public static info(s: string) since 0.0.2 source

A wrapper for INFO output

Params:

NameTypeAttributeDescription
s string

One or many string inputs

Example:

new $LogProvider.info('test');

public static warn(s: string) since 0.0.2 source

A wrapper for WARN output

Params:

NameTypeAttributeDescription
s string

One or many string inputs

Example:

new $LogProvider.warn('test');

Public Constructors

public constructor(outfile: string | object, name: string, timestamp: boolean, level: string, silent: boolean) since 0.0.2 source

Instantiate a logger for use in the current module.

Params:

NameTypeAttributeDescription
outfile string | object

The file to which messages are logged, or a hash of options to pass the logger

outfile.outfile string

[param=process.cwd() + '/angie.log'] The file to which messages are logged

outfile.file string

[param=process.cwd() + '/angie.log'] The file to which messages are logged. All files will be relative to process.cwd().

outfile.name string

The name of the logger to be recorded in the log file

outfile.timestamp boolean

[param=true] Whether or not to include a timestamp in the log output

outfile.level string

[param='DEBUG'] The recorded log message level. Possible options: debug, error, info, warn

outfile.logLevel string

[param='DEBUG'] The recorded log message level. Possible options: debug, error, info, warn

outfile.silent boolean

[param=false] The recorded log message level. Possible options: debug, error, info, warn

name string

The name of the logger to be recorded in the log file

timestamp boolean

[param=true] Whether or not to include a timestamp in the log output

level string

[param='DEBUG'] The recorded log message level. Possible options: debug, error, info, warn

silent boolean

[param=false] Should the log output also log to the terminal?

Example:

new $LogProvider(output.log, 'test', true, 'DEBUG', false);

Public Members

public $$initialLevel: * source

public $$level: * source

public $$name: * source

public $$outfile: * source

public $$silent: * source

public $$timestamp: * source

Public Methods

public debug(): * since 0.9.7 source

Logs a debug message to an outfile and to the terminal (unless otherwise specified). Allows any any arguments.

Return:

*

Example:

new $LogProvider({ ...args }).debug('test');

public error(): * since 0.9.7 source

Logs an error to an outfile and to the terminal (unless otherwise specified). Allows any any arguments.

Return:

*

Example:

new $LogProvider({ ...args }).error('test');

public info(): * since 0.9.7 source

Logs info to an outfile and to the terminal (unless otherwise specified)

Return:

*

Example:

new $LogProvider({ ...args }).info('test');

public warn(): * since 0.9.7 source

Logs a warning to an outfile and to the terminal (unless otherwise specified). Allows any any arguments.

Return:

*

Example:

new $LogProvider({ ...args }).warn('test');