@antora/logger
Advanced tools
Comparing version 3.0.0-alpha.8 to 3.0.0-alpha.9
@@ -9,3 +9,2 @@ 'use strict' | ||
const { | ||
destination: buildDest, | ||
levels: { labels: levelLabels, values: levelValues }, | ||
@@ -15,2 +14,3 @@ symbols: { streamSym }, | ||
} = require('pino') | ||
const SonicBoom = require('sonic-boom') | ||
@@ -29,5 +29,9 @@ const closedLogger = { closed: true } | ||
const dest = Object.assign(rootLogger, closedLogger)[streamSym].stream || rootLogger[streamSym] | ||
if (dest instanceof EventEmitter && typeof dest.end === 'function' && (dest._buf || !(dest.fd in standardStreams))) { | ||
finalizers.push(once(dest, 'close').catch(() => undefined)) | ||
dest.end() | ||
if (dest instanceof EventEmitter && typeof dest.end === 'function') { | ||
if (!(dest.fd in standardStreams)) { | ||
finalizers.push(once(dest, 'close').catch(() => undefined)) | ||
dest.end() | ||
} else if (dest._buf) { | ||
finalizers.push(new Promise((resolve) => fs.write(dest.fd, dest._buf, () => resolve((dest._buf = ''))))) | ||
} | ||
} | ||
@@ -46,14 +50,12 @@ } | ||
if (typeof (destination || (destination = {})).write !== 'function') { | ||
const { file, append = true, bufferSize, ...destOpts } = destination | ||
const { file, bufferSize, ...destOpts } = destination | ||
if (bufferSize != null) destOpts.minLength = bufferSize | ||
if (file && !(dest = standardStreams[file])) { | ||
dest = expandPath(file, { dot: baseDir }) | ||
try { | ||
fs.mkdirSync(ospath.dirname(dest), { recursive: true }) | ||
if (!append) fs.unlinkSync(dest) | ||
} catch {} | ||
} else if (process.env.NODE_ENV !== 'test') { | ||
colorize = true | ||
} else if (prettyPrint) { | ||
dest = dest || 2 | ||
if (process.env.NODE_ENV !== 'test') colorize = true | ||
} | ||
destination = buildDest(Object.assign({ sync: true }, destOpts, { dest: dest || (prettyPrint ? 2 : 1) })) | ||
destOpts.dest = dest || 1 | ||
destination = new SonicBoom(Object.assign({ mkdir: true, sync: true }, destOpts)) | ||
} | ||
@@ -60,0 +62,0 @@ close() |
{ | ||
"name": "@antora/logger", | ||
"version": "3.0.0-alpha.8", | ||
"version": "3.0.0-alpha.9", | ||
"description": "The logger for Antora.", | ||
@@ -19,4 +19,5 @@ "license": "MPL-2.0", | ||
"@antora/expand-path-helper": "~2.0", | ||
"pino": "~6.11", | ||
"pino-pretty": "~5.1" | ||
"pino": "~6.13", | ||
"pino-pretty": "~6.0", | ||
"sonic-boom": "~2.1" | ||
}, | ||
@@ -38,3 +39,3 @@ "engines": { | ||
], | ||
"gitHead": "2e5695bea11fb5719989c329c97e66d36e29659f" | ||
"gitHead": "a504d6889819b548e8a5416a7194cbb6f9a93e93" | ||
} |
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
27345
223
4
+ Addedsonic-boom@~2.1
+ Addedcolorette@1.4.0(transitive)
+ Addedpino@6.13.4(transitive)
+ Addedpino-pretty@6.0.0(transitive)
+ Addedprocess-warning@1.0.0(transitive)
+ Addedsonic-boom@2.1.0(transitive)
- Removedansi-styles@4.3.0(transitive)
- Removedchalk@4.1.2(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removedhas-flag@4.0.0(transitive)
- Removedpino@6.11.3(transitive)
- Removedpino-pretty@5.1.3(transitive)
- Removedsupports-color@7.2.0(transitive)
Updatedpino@~6.13
Updatedpino-pretty@~6.0