(data: any)
| 42 | } |
| 43 | |
| 44 | private formatLogContent(data: any): string { |
| 45 | if (typeof data === 'string') { |
| 46 | return this.formatMultilineString(data); |
| 47 | } |
| 48 | |
| 49 | const formatValue = (value: any): any => { |
| 50 | if (typeof value === 'string') { |
| 51 | return this.formatMultilineString(value); |
| 52 | } |
| 53 | if (typeof value === 'object' && value !== null) { |
| 54 | if (Array.isArray(value)) { |
| 55 | return value.map(formatValue); |
| 56 | } |
| 57 | const formatted: any = {}; |
| 58 | for (const [key, val] of Object.entries(value)) { |
| 59 | formatted[key] = formatValue(val); |
| 60 | } |
| 61 | return formatted; |
| 62 | } |
| 63 | return value; |
| 64 | }; |
| 65 | |
| 66 | return JSON.stringify(formatValue(data), null, 4); |
| 67 | } |
| 68 | |
| 69 | public async writeLog(type: string, data: any) { |
| 70 | try { |
no test coverage detected