## splunkjs.Logger Module Globals

### error

##### splunkjs.Logger.error

Logs debug errors to the console. This function is the same as `console.error`.

#### Syntax

error: function()

#### Source (lib/log.js:103)

    error: function() {
        if (process.env.LOG_LEVEL >= levels.ERROR) {
            _error.apply(null, arguments);
        }
    },

### info

##### splunkjs.Logger.info

Logs debug info to the console. This function is the same as `console.info`.

#### Syntax

info: function()

#### Source (lib/log.js:127)

    info: function() {
        if (process.env.LOG_LEVEL >= levels.INFO) {
            _info.apply(null, arguments);
        }
    },

### log

##### splunkjs.Logger.log

Logs debug messages to the console. This function is the same as `console.log`.

#### Syntax

log: function()

#### Source (lib/log.js:91)

    log: function() {
        if (process.env.LOG_LEVEL >= levels.ALL) {
            _log.apply(null, arguments);
        }
    },

### printMessages

##### splunkjs.Logger.printMessages

Prints all messages that are retrieved from the splunkd server to the console.

#### Syntax

printMessages: function(allMessages)

#### Source (lib/log.js:139)

    printMessages: function(allMessages) {
        allMessages = allMessages || [];

        for(var i = 0; i < allMessages.length; i++) {
            var message = allMessages[i];
            var type = message["type"];
            var text = message["text"];
            var msg = '[SPLUNKD] ' + text;
            switch (type) {
                case 'HTTP':
                case 'FATAL':
                case 'ERROR':
                    this.error(msg);
                    break;
                case 'WARN':
                    this.warn(msg);
                    break;
                case 'INFO':
                    this.info(msg);
                    break;
                case 'HTTP':
                    this.error(msg);
                    break;
                default:
                    this.info(msg);
                    break;
            }
        }
    },

### setLevel

##### splunkjs.Logger.setLevel

Sets the global logging level to indicate which information to log.

#### Syntax

setLevel: function(level)

#### Parameters

Name | Type | Description
--- | --- | ---
level | String,Number | A string or number ("ALL" = 4 | "INFO" = 3 | "WARN" = 2 | "ERROR" = 1 | "NONE" = 0) indicating the logging level.

#### Examples

     splunkjs.Logger.setLevel("WARN");
     splunkjs.Logger.setLevel(0); // equivalent to NONE

#### Source (lib/log.js:181)

    setLevel: function(level) { setLevel.apply(this, arguments) },

### warn

##### splunkjs.Logger.warn

Logs debug warnings to the console. This function is the same as `console.warn`.

#### Syntax

warn: function()

#### Source (lib/log.js:115)

    warn: function() {
        if (process.env.LOG_LEVEL >= levels.WARN) {
            _warn.apply(null, arguments);
        }
    },