2.0.1 • Published 5 months ago

apdev-logger v2.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

APDev Logger

This logger is made by a developer for the developers to make their logging experience beautiful.

Installing the package

npm install apdev-logger

Steps to use

Step-1 : Initialize a class object

import {APDevLogger, trace, logLevel, logTypes} from "apdev-logger";;
const  apLogger  =  new  APDevLogger({type:  logTypes.TEXT,  colorized:true,  switch:  'on'});

type: logTypes.JSON | logTypes.TEXT ( default: TEXT ) - optional colorized: true | false default: true - optional switch: 'on' | 'off' default: 'on' (In case you want to use regular console logs) - optional

Step-2 : Use the instance

apLogger.log(logLevel.DEBUG,'Reaching this checkpoint...',null,trace());
apLogger.log(logLevel.INFO,'User is active now!');
apLogger.log(logLevel.SUCCESS,'Successfully stored Data',{value:123,name:'arth'});
apLogger.log(logLevel.WARNING,'Database connection is down!',null,trace());
apLogger.log(logLevel.ERROR,'Failed to save User data',{value:123,name:'arth'},trace());

Param-1: Level of logs Param-2: Message string/stringify json Param-3: Extra JSON Data if any - optional(should be null if want to use Param-4) Param-4: If want to add line tracing to logs - optional

Text Output

Text Log Output

JSON Output

JSON Log Output

Thanks for using !

Give Your feedbacks and suggest something that I can build to make JavaScript easier for developers.

2.0.1

5 months ago

2.0.0

6 months ago

1.1.0

9 months ago

1.0.11

9 months ago

1.0.10

9 months ago

1.0.9

9 months ago

1.0.8

9 months ago

1.0.7

9 months ago

1.0.6

9 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago