Comparing version 3.1.2 to 3.2.0
@@ -0,1 +1,13 @@ | ||
<a name="3.2.0"></a> | ||
# 3.2.0 (2017-04-14) | ||
* Add %J formatter ([4192659](https://github.com/achohq/acho/commit/4192659)) | ||
* Refactor formatter ([99585a6](https://github.com/achohq/acho/commit/99585a6)) | ||
* Update deps ([e5283d7](https://github.com/achohq/acho/commit/e5283d7)) | ||
* Update README.md ([b325807](https://github.com/achohq/acho/commit/b325807)) | ||
* Update travis builds ([77a2452](https://github.com/achohq/acho/commit/77a2452)) | ||
* chore(package): update dependencies ([76eb538](https://github.com/achohq/acho/commit/76eb538)) | ||
<a name="3.1.2"></a> | ||
@@ -2,0 +14,0 @@ ## 3.1.2 (2017-03-03) |
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://github.com/achohq/acho", | ||
"version": "3.1.2", | ||
"version": "3.2.0", | ||
"main": "./index.js", | ||
@@ -30,4 +30,6 @@ "author": { | ||
"chalk": "~1.1.1", | ||
"coffee-script": "~1.11.0", | ||
"pretty-ms": "~2.1.0" | ||
"coffee-script": "~1.12.4", | ||
"fmt-obj": "~1.3.0", | ||
"pretty-ms": "~2.1.0", | ||
"sliced": "~1.0.1" | ||
}, | ||
@@ -34,0 +36,0 @@ "devDependencies": { |
@@ -162,2 +162,4 @@ # acho | ||
See more at [examples/levels](https://github.com/achohq/acho/blob/master/examples/levels.js). | ||
### Customization | ||
@@ -199,2 +201,48 @@ | ||
## Formatters | ||
We use [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. Below are the officially supported formatters: | ||
| Formatter | Representation | | ||
|-----------|---------------------------------------------------------------| | ||
| `%s` | String. | | ||
| `%d` | Number (both integer and float). | | ||
| `%j` | JSON serialization in one line | | ||
| `%J` | JSON pretty object in multiple lines | | ||
| `%%` | Single percent sign ('%'). This does not consume an argument. | | ||
By default, the `%j` is applied when you pass an object to be logged: | ||
```js | ||
acho.info({hello: 'world', foo: 'bar'}) | ||
// => 'info hello=world foo=bar' | ||
``` | ||
If you want to use a different formatter, use printf markup: | ||
```js | ||
acho.info('formatting with object interpolation %J', { | ||
hello: 'world', | ||
foo: 'bar', | ||
deep: { | ||
foo: 'bar', | ||
arr: [1, 2, 3, 4, 5] | ||
} | ||
}) | ||
// info formatting with object interpolation | ||
// hello: "world" | ||
// foo: "bar" | ||
// deep: | ||
// foo: "bar" | ||
// arr: | ||
// 0: 1 | ||
// 1: 2 | ||
// 2: 3 | ||
// 3: 4 | ||
// 4: 5 | ||
``` | ||
See more at [examples/formatter](https://github.com/achohq/acho/blob/master/examples/formatter.js). | ||
## API | ||
@@ -220,3 +268,3 @@ | ||
Default: ` ` | ||
Default: `' '` | ||
@@ -223,0 +271,0 @@ It adds an alignment separator between the type of the message and the message. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39675
361
5
+ Addedfmt-obj@~1.3.0
+ Addedsliced@~1.0.1
+ Addedarray-find-index@1.0.2(transitive)
+ Addedcamelcase@2.1.1(transitive)
+ Addedcamelcase-keys@2.1.0(transitive)
+ Addedcoffee-script@1.12.7(transitive)
+ Addedcurrently-unhandled@0.4.1(transitive)
+ Addeddecamelize@1.2.0(transitive)
+ Addederror-ex@1.3.2(transitive)
+ Addedfind-up@1.1.2(transitive)
+ Addedfmt-obj@1.3.0(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-stdin@4.0.1(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhosted-git-info@2.8.9(transitive)
+ Addedindent-string@2.1.0(transitive)
+ Addedis-arrayish@0.2.1(transitive)
+ Addedis-core-module@2.16.1(transitive)
+ Addedis-utf8@0.2.1(transitive)
+ Addedload-json-file@1.1.0(transitive)
+ Addedlongest@1.0.1(transitive)
+ Addedloud-rejection@1.6.0(transitive)
+ Addedlpad-align@1.1.2(transitive)
+ Addedmap-obj@1.0.1(transitive)
+ Addedmeow@3.7.0(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addednormalize-package-data@2.5.0(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedparse-json@2.2.0(transitive)
+ Addedpath-exists@2.1.0(transitive)
+ Addedpath-parse@1.0.7(transitive)
+ Addedpath-type@1.1.0(transitive)
+ Addedpify@2.3.0(transitive)
+ Addedpinkie@2.0.4(transitive)
+ Addedpinkie-promise@2.0.1(transitive)
+ Addedread-pkg@1.1.0(transitive)
+ Addedread-pkg-up@1.0.1(transitive)
+ Addedredent@1.0.0(transitive)
+ Addedrepeating@2.0.1(transitive)
+ Addedresolve@1.22.10(transitive)
+ Addedsemver@5.7.2(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedsliced@1.0.1(transitive)
+ Addedspdx-correct@3.2.0(transitive)
+ Addedspdx-exceptions@2.5.0(transitive)
+ Addedspdx-expression-parse@3.0.1(transitive)
+ Addedspdx-license-ids@3.0.20(transitive)
+ Addedstrip-bom@2.0.0(transitive)
+ Addedstrip-indent@1.0.1(transitive)
+ Addedsupports-preserve-symlinks-flag@1.0.0(transitive)
+ Addedtrim-newlines@1.0.0(transitive)
+ Addedtsml@1.0.1(transitive)
+ Addedvalidate-npm-package-license@3.0.4(transitive)
- Removedcoffee-script@1.11.1(transitive)
Updatedcoffee-script@~1.12.4