1.1.6 • Published 5 years ago

javascript-logger v1.1.6

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

javascript-logger

Conditional javascript console logger

Installation

npm i javascript-logger --save

Enabling logging/tracing by querystring

Add 'jsDebug' to your url querystring

Enabling logging/tracing by localStorage

Add 'jsDebug' key to the localstorage object

localStorage.setItem("jsDebug", "1") // To enable logging
localStorage.setItem("jsDebug", "2") // To enable tracing
localStorage.setItem("jsDebug", "3") // To enable logging and tracing

jsDebug values

  • jsDebug = 1 enables displaying of logs in the console window
  • jsDebug = 2 enables displaying of trace commands in the console window
  • jsDebug = 3 enables displaying of log and trace commands in the console window

TypeScript

import { Logger } from 'javascript-logger';

Logger.log("Logging test 1");
Logger.log('%s, %s', var1, var2);
Logger.log(`Logging test 3: ${this.properties.value1}`);

Logger.trace(`Tracing test 1: ${this.properties.value1}`);
1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

2.0.0

5 years ago