Comparing version 6.0.0 to 7.0.0
@@ -9,3 +9,3 @@ "use strict"; | ||
const globalthis_1 = __importDefault(require("globalthis")); | ||
const log_1 = __importDefault(require("../src/log")); | ||
const Roarr_1 = require("../src/Roarr"); | ||
// eslint-disable-next-line node/no-process-env | ||
@@ -26,3 +26,3 @@ if (process.env.ROARR_LOG !== 'true') { | ||
suite.add('simple message', () => { | ||
log_1.default.info('foo'); | ||
Roarr_1.Roarr.info('foo'); | ||
}, { | ||
@@ -36,3 +36,3 @@ setup: () => { | ||
suite.add('message with printf', () => { | ||
log_1.default.info('foo %s %s %s', 'bar', 'baz', 'qux'); | ||
Roarr_1.Roarr.info('foo %s %s %s', 'bar', 'baz', 'qux'); | ||
}, { | ||
@@ -46,3 +46,3 @@ setup: () => { | ||
suite.add('message with context', () => { | ||
log_1.default.info({ | ||
Roarr_1.Roarr.info({ | ||
foo: 'bar', | ||
@@ -59,3 +59,3 @@ }, 'foo'); | ||
suite.add('message with large context', () => { | ||
log_1.default.info(largeContext, 'foo'); | ||
Roarr_1.Roarr.info(largeContext, 'foo'); | ||
}, { | ||
@@ -75,3 +75,3 @@ setup: () => { | ||
suite.add('message with large context', () => { | ||
log_1.default.info(largeContextWithCircularReference, 'foo'); | ||
Roarr_1.Roarr.info(largeContextWithCircularReference, 'foo'); | ||
}, { | ||
@@ -78,0 +78,0 @@ setup: () => { |
@@ -66,3 +66,3 @@ { | ||
"license": "BSD-3-Clause", | ||
"main": "./dist/src/log.js", | ||
"main": "./dist/src/Roarr.js", | ||
"name": "roarr", | ||
@@ -82,3 +82,3 @@ "repository": { | ||
"typings": "./dist/src/log.d.ts", | ||
"version": "6.0.0" | ||
"version": "7.0.0" | ||
} |
@@ -87,3 +87,5 @@ <a name="roarr"></a> | ||
```js | ||
import log from 'roarr'; | ||
import { | ||
Roarr as log, | ||
} from 'roarr'; | ||
@@ -276,7 +278,7 @@ log('foo'); | ||
```js | ||
await log.adopt( | ||
async () => { | ||
log.adopt( | ||
() => { | ||
log('foo 0'); | ||
await log.adopt( | ||
log.adopt( | ||
() => { | ||
@@ -298,3 +300,3 @@ log('foo 1'); | ||
{"context":{"bar":"bar 0"},"message":"foo 0","sequence":"0","time":1506776210000,"version":"2.0.0"} | ||
{"context":{"bar":"bar 0","baz": "baz 1"},"message":"foo 1","sequence":"0.0","time":1506776210000,"version":"2.0.0"} | ||
{"context":{"bar":"bar 0","baz":"baz 1"},"message":"foo 1","sequence":"0.0","time":1506776210000,"version":"2.0.0"} | ||
``` | ||
@@ -320,3 +322,5 @@ | ||
log('baz 0'); | ||
log('baz 1'); | ||
setTimeout(() => { | ||
log('baz 1'); | ||
}, 10); | ||
}); | ||
@@ -333,5 +337,7 @@ log('bar 1'); | ||
{"context":{},"message":"bar 1","sequence":"0.1.2","time":1506776210000,"version":"2.0.0"} | ||
{"context":{},"message":"baz 1","sequence":"0.1.1.1","time":1506776210000,"version":"2.0.0"} | ||
{"context":{},"message":"baz 1","sequence":"0.1.1.1","time":1506776210010,"version":"2.0.0"} | ||
``` | ||
Notice that even though logs `baz 0` and `baz 1` were produced at different times, you can tell that one was produced after another by looking at their sequence values `0.1.1.0` and `0.1.1.1`. | ||
<a name="roarr-api-adopt-requirements"></a> | ||
@@ -368,3 +374,5 @@ #### Requirements | ||
```js | ||
import log from 'roarr'; | ||
import { | ||
Roarr as log, | ||
} from 'roarr'; | ||
@@ -399,3 +407,5 @@ const childLog = log.child({ | ||
```js | ||
import log from 'roarr'; | ||
import { | ||
Roarr as log, | ||
} from 'roarr'; | ||
@@ -426,3 +436,5 @@ const childLog = log.child((message) => { | ||
```js | ||
import log from 'roarr'; | ||
import { | ||
Roarr as log, | ||
} from 'roarr'; | ||
@@ -455,3 +467,5 @@ const childLogger = log.child({ | ||
```js | ||
import log from 'roarr'; | ||
import { | ||
Roarr as log, | ||
} from 'roarr'; | ||
@@ -485,3 +499,5 @@ log.trace('foo'); | ||
```js | ||
import log from 'roarr'; | ||
import { | ||
Roarr as log, | ||
} from 'roarr'; | ||
import createSerializeErrorMiddleware from '@roarr/middleware-serialize-error'; | ||
@@ -596,3 +612,5 @@ | ||
import log from 'roarr'; | ||
import { | ||
Roarr as log, | ||
} from 'roarr'; | ||
@@ -624,3 +642,5 @@ const Logger = log.child({ | ||
```js | ||
import log from 'roarr'; | ||
import { | ||
Roarr as log, | ||
} from 'roarr'; | ||
import serializeError from 'serialize-error'; | ||
@@ -627,0 +647,0 @@ |
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
64967
761