ark-ng-log
v0.0.3
Published
Simple angular utility library for colourful console log conditionally enable
Downloads
3
Maintainers
Readme
Simple angular library for colorful console log..!
Simple angular utility library for colourful console log conditionally enable...
- if in devMode then all looging verbose is enabled & the console output, but in prodMode by default log is diabled.
npm i ark-ng-log
Documentation
-- Supported logs -> info, warn, error, success
1. Use in Component
import { ArkLog } from 'ark-ng-log';
export class AppComponent {
constructor(private log: ArkLog)
getConfigValue() {
log.info('TAG', 'Some Detail message for console logg...'); // prints on the output in the console with appropriate color styling
log.success('TAG', 'Some Detail message for console logg...');
log.error('TAG', 'Some Detail message for console logg...');
log.warning('TAG', 'Some Detail message for console logg...');
}
id devMode: all log is set to true & in prodMode this is set to false; manually change thee properties to either enable or diable the appropriate log.
var arklog = {
info: true,
warn: true,
succ: true,
error: true
}
}
cheat sheet:
->
-> in develper console declare below variables to enable or disable specific prints.
var arklog.info = true/false; // Enable or disable the info logs
functions:
-- this.config.getValue('globalvar')
-- this.config.getIp(); // Returns the current public ip (used - ipify.org internally)
Note: include 'HttpClientModule' in app.module.ts, since this is used to detect IP
import { HttpClientModule } from '@angular/common/http';
imports: [
HttpClientModule
]
Tested on modern browsers
Issues: [email protected]