Skip to content

Commit 9821db0

Browse files
committed
feat: Add styles for browser. Add methods concatenation.
1 parent d454b72 commit 9821db0

11 files changed

+133
-169
lines changed

README.md

+17-14
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
88

99

10-
#### 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.
1111

1212

1313
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:
3333
## Features
3434

3535
* 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.
3737
* Production ready for **server and front-end sides**. Learn one, implement everywhere.
3838
* Super **lightweight**, weighs in at 1.1KB minified and gzipped.
3939
* Implements **human-like** code style: `logatim.green.bold.info('super sexy')`
@@ -61,7 +61,7 @@ The logatim API is tend to be extremly minimal and human-like. It has two differ
6161

6262
### Styles
6363

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:
6565

6666
```es6
6767
const logatim = require('logatim')
@@ -76,11 +76,11 @@ logatim.info("I'm a boring log")
7676

7777
```
7878

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).
8080

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.
8282

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*).
8484

8585
### Levels
8686
* Use the five `console` native **logging methods** (aka levels):
@@ -90,9 +90,12 @@ const logatim = require('logatim')
9090
// sorted from bottom in the bubbling logging scale
9191
logatim.trace('Good for track pathways')
9292
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')
9699
```
97100
* And change the **current level** using the get/set methods:
98101
```es6
@@ -104,18 +107,17 @@ logatim.setLevel('info')
104107
logatim.debug("I'll be printed") // because debug is greater than info
105108
```
106109

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.
108111

109112

110113
## Contributing
111114

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.
113116

114117
```bash
115118
git clone https://github.com/edravis/logatim.git
116119
cd logatim
117120
npm install
118-
npm test
119121
# edit logatim
120122

121123
# when done
@@ -132,14 +134,15 @@ If you feel that the force is strong in Logatim keep an eye to the todo list and
132134
* Add the CI for client-side environments.
133135
* Add Logatim to other source providers: bower, a CDN, etc.
134136
* Write the technical in-code documentation.
137+
* Allow custom prints depending on the level or globally.
135138

136-
## Dat name, tho
139+
## *Dat name, tho*
137140
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**.
138141

139142
## License
140143
The code is available under the [ISC license](LICENSE.txt).
141144

142145
Handcrafted by [@sospedra\_r](http://twitter.com/sospedra\_r) / [sospedra.me](http://sospedra.me).
143146

144-
With contributions from:
147+
With [contributions](https://github.com/edravis/logatim/graphs/contributors) from:
145148
* [be the first here, make a PR!]

dist/logatim.amd.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)