mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
use inspect instead of json.serialize for raw objects to prevent errors with circular objects
This commit is contained in:
parent
bedafc4592
commit
d50c2fd276
@ -1,6 +1,7 @@
|
||||
import { Level, LoggingEvent } from 'log4js'
|
||||
import colors from 'yoctocolors-cjs'
|
||||
import { ColoredContextLayoutConfig, LogLevel } from './types'
|
||||
import { inspect } from 'node:util'
|
||||
|
||||
function colorize(str: string, level: Level): string {
|
||||
switch (level.colour) {
|
||||
@ -33,7 +34,7 @@ function composeDataString(data: (string | Object)[]): string {
|
||||
.map((d) => {
|
||||
// if it is a object and his toString function return only garbage
|
||||
if (typeof d === 'object' && d.toString() === '[object Object]') {
|
||||
return JSON.stringify(d)
|
||||
return inspect(d, )
|
||||
}
|
||||
if (d) {
|
||||
return d.toString()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user