Simple JavaScript logger written in TypeScript.
The package is most useful when used with TypeScript.
npm install simplr-logger
import { LoggerBuilder } from "simplr-logger";
const logger = new LoggerBuilder();
import { LoggerBuilder, LoggerConfigurationBuilder, LogLevel } from "simplr-logger";
const config = new LoggerConfigurationBuilder()
.SetLogLevel(LogLevel.Trace)
.Build();
const logger = new LoggerBuilder(config);
import { LoggerBuilder, LoggerConfigurationBuilder, LogLevel, Handlers } from "simplr-logger";
const logger = new LoggerBuilder({
LogLevel: LogLevel.Trace,
WriteMessageHandler: new Handlers.ConsoleMessageHandler()
});
logger.Critical("Critical", "message");
logger.Debug("Debug", "message");
logger.Error("Error", "message");
logger.Info("Info", "message");
logger.Warn("Warn", "message");
logger.Log(LogLevel.Information, "Info message");
logger.Log(LogLevel.Critical, new Error("Critical error"));
TODO
Released under the MIT license.