Comparing version 1.0.0-rc.2 to 1.0.0
@@ -133,3 +133,3 @@ # API | ||
A Writable stream. | ||
A Writable stream instance or a SonicBoom instance. | ||
@@ -161,3 +161,19 @@ ### format | ||
### dateFormat (optional) | ||
A date format supported by [fast-date-format](https://github.com/SerayaEryn/fast-date-format). Defaults to `YYYY-MM-DDTHH:mm:ss.SSS[Z]`. | ||
### serializers (optional) | ||
Allows to add custom serializers for objects. | ||
<a id="jsonformatapi"></a> | ||
## JsonFormat([options]) | ||
### dateFormat (optional) | ||
A date format supported by [fast-date-format](https://github.com/SerayaEryn/fast-date-format). Defaults to a timestamp. | ||
### serializers (optional) | ||
Allows to add custom serializers for objects. |
@@ -9,3 +9,3 @@ 'use strict' | ||
const jsonEscape = require('json-escaping') | ||
const { levelsSym, dateFormatterSym } = require('./Symbols') | ||
const { dateFormatterSym } = require('./Symbols') | ||
const fastifySerializers = require('./FastifySerializers').json | ||
@@ -19,3 +19,2 @@ | ||
}) | ||
this[levelsSym] = options.levels || DEFAULT_LEVELS | ||
this.serializers = options.serializers || fastifySerializers | ||
@@ -26,3 +25,3 @@ } | ||
let timestamp = this[dateFormatterSym].format() | ||
let line = `{"time":${timestamp},"level":${this[levelsSym][level]}` | ||
let line = `{"time":${timestamp},"level":${DEFAULT_LEVELS[level]}` | ||
@@ -29,0 +28,0 @@ let stack = null |
{ | ||
"name": "apheleia", | ||
"version": "1.0.0-rc.2", | ||
"version": "1.0.0", | ||
"description": "fast and simplistic logger.", | ||
@@ -5,0 +5,0 @@ "main": "lib/Apheleia.js", |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
56667
1
1542