How to use the loglevel.GetLogger function in loglevel

To help you get started, we’ve selected a few loglevel examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ibm-watson-iot / iot-nodejs / src / application / ApplicationConfig.js View on Github external
throw new Error("Error reading device configuration file: " + err.code);
          }
        }
        

        if (("options" in data) & ("logLevel" in data["options"]))
        {
            var validLevels = ["error", "warning", "info", "debug"];
            if (!(validLevels.includes(data["options"]["logLevel"])))
            {
                throw new Error("Optional setting options.logLevel (Currently: " + data["options"]["logLevel"] + ") must be one of error, warning, info, debug")
            }
        }
        else
        {
            data["options"]["logLevel"] = log.GetLogger(data["options"]["logLevel"].toUpperCase());
        }

        return new ApplicationConfig(data['identity'],data['auth'],data['options'])
    }
}
github ibm-watson-iot / iot-nodejs / src / device / DeviceConfig.js View on Github external
throw new Error("Error reading device configuration file: " + err.code);
          }
        }
        

        if (("options" in data) & ("logLevel" in data["options"]))
        {
            var validLevels = ["error", "warning", "info", "debug"];
            if (!(validLevels.includes(data["options"]["logLevel"])))
            {
                throw new Error("Optional setting options.logLevel (Currently: " + data["options"]["logLevel"] + ") must be one of error, warning, info, debug")
            }
        }
        else
        {
            data["options"]["logLevel"] = log.GetLogger(data["options"]["logLevel"].toUpperCase());
        }

        return new DeviceConfig(data['identity'],data['auth'],data['options'])
    }
}