Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/annotationsro/ember-simple-logger
Very simple replacement for Ember.Logger that supports callbacks on log
https://github.com/annotationsro/ember-simple-logger
hacktoberfest
Last synced: about 1 month ago
JSON representation
Very simple replacement for Ember.Logger that supports callbacks on log
- Host: GitHub
- URL: https://github.com/annotationsro/ember-simple-logger
- Owner: AnnotationSro
- License: mit
- Created: 2018-11-22T11:32:03.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-10-02T11:14:46.000Z (about 2 years ago)
- Last Synced: 2024-04-09T14:25:52.410Z (9 months ago)
- Topics: hacktoberfest
- Language: JavaScript
- Homepage:
- Size: 314 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
ember-simple-logger
==============================================================================Replacement for `Ember.Logger` that is deprecated in newer Ember versions. The only reason to use this addon is when you need a callback to be called when something is logged.
## Warning
This package is no longer maintained. You are probably better off without this addon either way.Compatibility
------------------------------------------------------------------------------* Ember.js v3.20 or above
* Ember CLI v3.20 or above
* Node.js v12 or aboveInstallation
------------------------------------------------------------------------------```
ember install ember-simple-logger
```Usage
------------------------------------------------------------------------------```
simpleLogger: service('simple-logger'),//............
this.get('simpleLogger').info('some text to log');
this.get('simpleLogger').info('you can log arguments as well', 1, 2, 3);
```To register a callback:
```
this.get('simpleLogger').registerCallback('info', (level, msg, args) => {
alert(`logged - level: ${level}; msg: ${msg}, arguments: ${args}`)
});
```Supported log levels:
* trace → `this.get('simpleLogger').trace(...);`
* debug → `this.get('simpleLogger').debug(...);`
* info → `this.get('simpleLogger').info(...);`
* warn → `this.get('simpleLogger').warn(...);`
* error → `this.get('simpleLogger').error(...);`License
------------------------------------------------------------------------------This project is licensed under the [MIT License](LICENSE.md).