0.0.9 • Published 4 years ago
@steveylin/ng2-logger v0.0.9
Table of contents
Usage
Install package
npm i @steveylin/logger --save
Add into code you want to display log
For example
File: app.component.ts
...
import { Logger } from '@steveylin/logger';
/**
* Main App Component
*/
@Component({
selector: 'steveylin-libs-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.less']
})
export class AppComponent implements OnInit {
// Create Logger instaance and setup the name.
private logger = new Logger(AppComponent.name);
constructor() {}
/**
* Initilailize component
*
* @method public
*/
public ngOnInit(): void {
// Logger supply 'log', 'data', 'warn' and 'error'
this.logger.log('This is a log');
this.logger.data('This is a data');
this.logger.warn('This is a warn');
this.logger.error('This is a error');
}
}
Preview
Status
Copyright and license
Code and documentation copyright 2020 Steve Y Lin.
0.0.9
4 years ago