Advanced-log
About
A module dedicated to organised, clean, simple logging. | Written in TypeScript.
Installation
npm i advanced-log
Usage
Simple Warn Log
; ; log.warn'Hello World!';// Logs '[ WARN ] | MM/DD/YYYY, H:MM:SS AM/PM | Hello World!' in native Orange warn() color. log.warn'Hello World!', true;// Logs '[ WARN ] | MM/DD/YYYY, H:MM:SS AM/PM | Hello World!' in persistColor #ff0000 color.
Using Custom Logs
; ; ; logNewEmail'Hello World!';// Logs '[ NEW EMAIL ] | MM/DD/YYYY, H:MM:SS AM/PM | Hello World!' in specified #b5b5b5 color.
Documentation
Basic Logs
error!:void;
Parameters:
- Content: Content to display in the error log. (String)
- Persist?: Whether the persistColor will be used or not. (Boolean, defaults to false.)
Usage:
- new AdvancedLog({}).error()
warn!:void;
Parameters:
- Content: Content to display in the warn log. (String)
- Persist?: Whether the persistColor will be used or not. (Boolean, defaults to false.)
Usage:
- new AdvancedLog({}).warn()
info!:void;
Parameters:
- Content: Content to display in the info log. (String)
- Persist?: Whether the persistColor will be used or not. (Boolean, defaults to false.)
Usage:
- new AdvancedLog({}).info()
debug!:void;
Parameters:
- Content: Content to display in the debug log. (String)
- Persist?: Whether the persistColor will be used or not. (Boolean, defaults to false.)
Usage:
- new AdvancedLog({}).debug()
log!:void;
Parameters:
- Content: Content to display in the log. (String)
- Persist?: Whether the persistColor will be used or not. (Boolean, defaults to false.)
Usage:
- new AdvancedLog({}).log()
plus!:void;
Parameters:
- Content: Content to display in the plug log. (String)
- Persist?: Whether the persistColor will be used or not. (Boolean, defaults to false.)
Usage:
- new AdvancedLog({}).plug()
minus!:void;
Parameters:
- Content: Content to display in the minus log. (String)
- Persist?: Whether the persistColor will be used or not. (Boolean, defaults to false.)
Usage:
- new AdvancedLog({}).minus()
Custom Logs
custom!:void;
Parameters:
- Name: The name of the custom log. (String)
- Content: Content to display in the custom log. (String)
- Color?: The color of the custom log, if not the persistColor. (String, defaults to '#FFFFFF')
Usage:
- new AdvancedLog({}).custom()