2019-06-06 01:21:26 +02:00
|
|
|
# tagol
|
|
|
|
|
2019-06-06 01:41:21 +02:00
|
|
|
Another logger using template literals for nodejs and browsers
|
|
|
|
|
|
|
|
WIP !
|
|
|
|
|
|
|
|
## Load
|
|
|
|
|
|
|
|
### Browsers
|
|
|
|
|
|
|
|
```html
|
|
|
|
<script src="//unpckg.org/tagol/tagol.js"></script>
|
|
|
|
or
|
|
|
|
<script type="module">
|
|
|
|
import log from '//unpckg.org/tagol/tagol.js'
|
|
|
|
</script>
|
|
|
|
```
|
|
|
|
|
|
|
|
### Nodejs
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
require('tagol')
|
|
|
|
or
|
|
|
|
import 'tagol'
|
|
|
|
or
|
|
|
|
import log from 'tagol'
|
|
|
|
or
|
|
|
|
import { I: info, E: error } from 'tagol'
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
log `Some simple output`
|
|
|
|
|
|
|
|
log.S `Success`
|
|
|
|
log.W `Warning`
|
|
|
|
log.I `Info`
|
|
|
|
log.E `Error`
|
|
|
|
|
|
|
|
log `Some
|
|
|
|
multiline
|
|
|
|
text`
|
|
|
|
|
|
|
|
let substitution = { text: 'foo', obj: {some: 42} }
|
|
|
|
log.E `Error with ${substitution.text}s on object ${substitution.obj}o !`
|
|
|
|
```
|
|
|
|
|