@ng-avocado/ngx-logger
v2.0.0
Published
Creative logger for Angular
Downloads
4
Readme
Getting started
$ yarn add @ng-avocado/ngx-logger
Add to Angular module
import {NgxLoggerModule} from '@ng-avocado/ngx-logger';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
NgxLoggerModule.forRoot()
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule {
}
Use it everywhere
import {NgxLog, NgxLogger} from '@ng-avocado/ngx-logger';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {
title = 'app';
log: NgxLog = NgxLogger.create('AppComponent');
constructor() {
}
ngOnInit(): void {
this.log.info('Yay!, This is cool.');
this.log.error('Opps!', new Error('Happy error'));
}
}