统一前后端代码格式化配置
This commit is contained in:
@@ -175,9 +175,7 @@ function enqueueFileWrite(
|
||||
sanitize: boolean,
|
||||
jsonLine = false,
|
||||
): void {
|
||||
const line = jsonLine
|
||||
? JSON.stringify(entry)
|
||||
: formatLogEntry(entry, { color: false, sanitize })
|
||||
const line = jsonLine ? JSON.stringify(entry) : formatLogEntry(entry, { color: false, sanitize })
|
||||
const dateKey = extractLogDateKey(entry.time)
|
||||
|
||||
writeQueue = writeQueue
|
||||
@@ -279,7 +277,9 @@ export function resolveLogFilePath(channel = 'app', time = new Date().toISOStrin
|
||||
}
|
||||
|
||||
function normalizeLogChannelName(value: unknown): string {
|
||||
const normalized = String(value || '').trim().toLowerCase()
|
||||
const normalized = String(value || '')
|
||||
.trim()
|
||||
.toLowerCase()
|
||||
if (!normalized) {
|
||||
return 'app'
|
||||
}
|
||||
@@ -344,7 +344,9 @@ function normalizeLogValue(value: unknown, sanitize = true): unknown {
|
||||
|
||||
try {
|
||||
return sanitize
|
||||
? sanitizeLogValue(JSON.parse(JSON.stringify(value, (_key, current) => normalizeCurrent(current))))
|
||||
? sanitizeLogValue(
|
||||
JSON.parse(JSON.stringify(value, (_key, current) => normalizeCurrent(current))),
|
||||
)
|
||||
: JSON.parse(JSON.stringify(value, (_key, current) => normalizeCurrent(current)))
|
||||
} catch {
|
||||
return sanitize ? sanitizeLogString(String(value)) : String(value)
|
||||
|
||||
Reference in New Issue
Block a user