You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#### Logatim is an isomorphic logger which implements log levels and ANSI styles.
10
+
#### Logatim is an isomorphic logger which implements log levels and ANSI 16 styles.
11
11
12
12
13
13
Finally you can use the same logger for the **server and client side** of your applications. Log for developers using **colors, underlines, etc.** in order to transform the terminal in an authenitc debugger machine. And log for production **managing exactly what have** and what have not **to be outputed**.
@@ -33,7 +33,7 @@ Choose one of the following options:
33
33
## Features
34
34
35
35
* Logatim has **colors**, **background colors** and **text styles**.
36
-
* Implements the five **native console logging methods**: trace, debug, info, warn and error.
36
+
* Implements the five **native console logging methods**: trace, debug, info, warn and error. And also the slient mode.
37
37
* Production ready for **server and front-end sides**. Learn one, implement everywhere.
38
38
* Super **lightweight**, weighs in at 1.1KB minified and gzipped.
@@ -61,7 +61,7 @@ The logatim API is tend to be extremly minimal and human-like. It has two differ
61
61
62
62
### Styles
63
63
64
-
* Use the **[ANSI styles](https://en.wikipedia.org/wiki/ANSI_escape_code)** in a concatenable way:
64
+
* Use the **[ANSI 16 styles](https://en.wikipedia.org/wiki/ANSI_escape_code)** in a concatenable way:
65
65
66
66
```es6
67
67
constlogatim=require('logatim')
@@ -76,11 +76,11 @@ logatim.info("I'm a boring log")
76
76
77
77
```
78
78
79
-
* The **colors** available are: black, red, green, yellow, blue, magenta, cyan, white, gray, grey.
79
+
* The **colors** available are: black, red, green, yellow, blue, magenta, cyan, white, gray and grey (fixing humans).
80
80
81
-
* The **background colors** available are: bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite.
81
+
* The **background colors** available are: bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bgGray and bgGrey.
82
82
83
-
* The **styles** available are: reset, bold, dim, italic, underline, inverse, hidden, strikethrough.
83
+
* The **sets** available are: bold, dim, italic, underline, blink, inverse, hidden, strikethrough (*Almost no browser [supports blink](https://developer.mozilla.org/en/docs/Web/CSS/text-decoration#Browser_compatibility) and inverse is not supported when printing on the browser's console*).
84
84
85
85
### Levels
86
86
* Use the five `console` native **logging methods** (aka levels):
// sorted from bottom in the bubbling logging scale
91
91
logatim.trace('Good for track pathways')
92
92
logatim.info('Good while developing')
93
-
logatim.debug('Good for find errors')
94
-
logatim.warn('Good for production')
95
-
logatim.error('Good for performance')
93
+
94
+
// combine them, each log may differ depending on the channel
95
+
logatim
96
+
.debug('Good for find errors')
97
+
.warn('Good for production')
98
+
.error('Good for performance')
96
99
```
97
100
* And change the **current level** using the get/set methods:
98
101
```es6
@@ -104,18 +107,17 @@ logatim.setLevel('info')
104
107
logatim.debug("I'll be printed") // because debug is greater than info
105
108
```
106
109
107
-
* Leveling also ensure that **your logs don't break antyhing**, even if there's not a `console` object (I'm staring to you IE) it will slient fallback to the safest print possible.
110
+
* Leveling also ensures that **your logs don't break anything**, even if there's not a `console` object (I'm staring at you IE) it will slient fallback to the safest print possible.
108
111
109
112
110
113
## Contributing
111
114
112
-
Please feel free to raise issues, or make contributions. Remember that we follow standar code style and the continous integration pattern so any pull request should run the tests first.
115
+
Please feel free to raise issues, make contributions or suggestions/requests. Remember that we follow [standard](https://github.com/feross/standard) code style and the continous integration pattern so any pull request should run the tests first.
113
116
114
117
```bash
115
118
git clone https://github.com/edravis/logatim.git
116
119
cd logatim
117
120
npm install
118
-
npm test
119
121
# edit logatim
120
122
121
123
# when done
@@ -132,14 +134,15 @@ If you feel that the force is strong in Logatim keep an eye to the todo list and
132
134
* Add the CI for client-side environments.
133
135
* Add Logatim to other source providers: bower, a CDN, etc.
134
136
* Write the technical in-code documentation.
137
+
* Allow custom prints depending on the level or globally.
135
138
136
-
## Dat name, tho
139
+
## *Dat name, tho*
137
140
Logatim comes from a combination of the words **[log](https://en.wikipedia.org/wiki/Logfile)** and **[verbatim](https://en.wiktionary.org/wiki/verbatim)**. The first one is obviously referred to the cutten trunk... lol no, it's for the coding logfiles. And the second one is a Latin term that can be translated as *word for word*. So, the term Logatim could be loosely translated as **log for log**.
138
141
139
142
## License
140
143
The code is available under the [ISC license](LICENSE.txt).
141
144
142
145
Handcrafted by [@sospedra\_r](http://twitter.com/sospedra\_r) / [sospedra.me](http://sospedra.me).
143
146
144
-
With contributions from:
147
+
With [contributions](https://github.com/edravis/logatim/graphs/contributors) from:
0 commit comments