logger-winston.js
function init(config) {
    // the given config is only applied if no config has been set already (stored as localConfig)
    if (Object.keys(localConfig).length === 0) {
        if (config.hasOwnProperty("logging") && (config.logging.constructor === {}.constructor)) {
            // config has "logging" key with an {} object value
            //console.log("LOGGER: Setting config");
            localConfig = _merge({}, config.logging);
        }
        else {
            // no valid config - use default
            localConfig = { default: { console: {}}};
        }
    }
}
function init(config) {
    // the given config is only applied if no config has been set already (stored as localConfig)
    if (Object.keys(localConfig).length === 0) {
        if (config.hasOwnProperty("logging") && (config.logging.constructor === {}.constructor)) {
            // config has "logging" key with an {} object value
            //console.log("LOGGER: Setting config");
            localConfig = _merge({}, config.logging);
        }
        else {
            // no valid config - use default
            localConfig = { default: { console: {}}};
        }
    }
}
function init ( config ) { // the given config is only applied if no config has been set already (stored as localConfig) if ( Object . keys ( localConfig ) . length === 0 ) { if ( config . hasOwnProperty ( "logging" ) && ( config . logging . constructor === { } . constructor ) ) { // config has "logging" key with an {} object value //console.log("LOGGER: Setting config"); localConfig = _merge ( { } , config . logging ) ; } else { // no valid config - use default localConfig = { default : { console : { } } } ; } } }
Initialize logging with the given configuration. As the given configuration will be cached internally the first
invocation will take effect, only. Make sure to invoke this function at the very beginning of the program before
other topics using logging get loaded.
@param {Object} config - The logging configuration.
@param {Object} config.logging - Contains the logging configuration for at least one winston container. A specific
container configuration can be provided by defining a configuration for a category matching the topicName. A
default configuration can provided by defining a container for the category "default". A container configuration
contains at least one transport configuration.
Note, you may run into an issue in strict mode, if you need to setup multiple transports of the same type, e.g.,
two file transports, as the strict mode inhibits duplicate object keys. In this case the transport name can be
augmented with a "#name" postfix, e.g. "file#debug".
@param {Object} [config.logging.[topicName]=default] - A specific container for a given topicName can be setup by
providing a container configuration where the property name is equal to given topicName. The container configuration
must contain at least one winston transport configuration. If the container configuration contains the key
"inheritDefault" set to true, the default configuration will be mixed in. This way, it possible to solely define
transport properties which shall differ from the default configuration.
@param {Object} [config.logging.default=builtin] - Contains the default configuration applicable to loggers without a
specific container configuration. The container configuration must contain at least one winston transport
configuration.  If no default configuration is provided a console transport configuration with
winston builtin defaults will be used.
Initialize logging with the given configuration . As the given configuration will be cached internally the first invocation will take effect only . Make sure to invoke this function at the very beginning of the program before other topics using logging get loaded .