@dynatrace/react-native-plugin
Version:
This plugin gives you the ability to use the Dynatrace Mobile agent in your react native application.
29 lines (28 loc) • 879 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConsoleLogger = void 0;
const ConfigurationHandler_1 = require("../configuration/ConfigurationHandler");
const LogLevel_1 = require("./LogLevel");
class ConsoleLogger {
constructor(name, logLevel) {
this.name = name;
this.level = logLevel;
}
debug(msg) {
if (this.isDebugEnabled()) {
this.logMessage(msg);
}
}
info(msg) {
this.logMessage(msg);
}
logMessage(msg) {
console.log(`[${this.name}]: ${msg}`);
}
isDebugEnabled() {
return (this.level === LogLevel_1.LogLevel.Debug ||
(ConfigurationHandler_1.ConfigurationHandler.isConfigurationAvailable() &&
ConfigurationHandler_1.ConfigurationHandler.isDebugEnabled()));
}
}
exports.ConsoleLogger = ConsoleLogger;