Skip to content

Very simple console wrapper in javascript. Preserves line numbers.

Notifications You must be signed in to change notification settings

chris-yoon90/simple-javascript-logger

Repository files navigation

Simple JavaScript Logger

Simple JavaScript Logger wrapper that preserves line numbers. Written in TypeScript, built with WebPack.

Example:

// Include simple-javascript-logger in your html.
<script src="simple-javascript-logger.js"></script>
// OR minified version
<script src="simple-javascript-logger.min.js"></script>


// In your javascript code, use it like this.
var logger = new Logger('MyLogger', 4); // Initialized with logging level 4. See below for logging level.

logger.Log('Hello World');
logger.Info('Hello World');
logger.Warn('Hello World');
logger.Error('Hello World');


// OR if you would like to use it as a module
import Logger, { eLogLevel } from 'simple-javascript-logger';

Above code will result in:

screen shot 2017-01-15 at 1 17 45 am

Logging level

  • Level 1: Only Error
  • Level 2: Error and Warn
  • Level 3: Error, Warn and Info
  • Level 4: Error, Warn, Info and Log

How to build

  1. npm install packages. You can also use yarn install.
  2. npm run build:dev to build unminified version.
  3. npm run build:prod to build minified version.

About

Very simple console wrapper in javascript. Preserves line numbers.

Resources

Stars

Watchers

Forks

Packages

No packages published