@ng-avocado/ngx-logger
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

Gulp-Yarn

🌀 Creative logger for Angular

npm version npm downloads module license npm size

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'));
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @ng-avocado/ngx-logger

Weekly Downloads

8

Version

2.0.0

License

MIT

Unpacked Size

89.9 kB

Total Files

39

Last publish

Collaborators

  • warapitiya