@steveylin/ng-logger
v0.0.10
Published
<p align="center"> <a href="#"> <img src="https://i.imgur.com/1xlpNX1.png" alt="Steve Y Lin logo" width="72" height="72"> </a> </p>
Downloads
4
Maintainers
Readme
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.