(data: unknown, style = DebugStyle.Info)
| 20 | * @param severity The severity of the message, defaults to info. |
| 21 | */ |
| 22 | export const logDebug = (data: unknown, style = DebugStyle.Info) => { |
| 23 | if (!environment.isDevelopment) return; |
| 24 | switch (style) { |
| 25 | case DebugStyle.Info: |
| 26 | console.log( |
| 27 | `[Debug] ${util.inspect(data, { |
| 28 | showHidden: true, |
| 29 | depth: null, |
| 30 | compact: false, |
| 31 | maxArrayLength: null, |
| 32 | maxStringLength: null, |
| 33 | })}`, |
| 34 | ); |
| 35 | break; |
| 36 | case DebugStyle.Warn: |
| 37 | console.warn( |
| 38 | `[Debug] ${util.inspect(data, { |
| 39 | showHidden: true, |
| 40 | depth: null, |
| 41 | compact: false, |
| 42 | maxArrayLength: null, |
| 43 | maxStringLength: null, |
| 44 | })}`, |
| 45 | ); |
| 46 | break; |
| 47 | case DebugStyle.Error: |
| 48 | console.error( |
| 49 | `[Debug] ${util.inspect(data, { |
| 50 | showHidden: true, |
| 51 | depth: null, |
| 52 | compact: false, |
| 53 | maxArrayLength: null, |
| 54 | maxStringLength: null, |
| 55 | })}`, |
| 56 | ); |
| 57 | break; |
| 58 | case DebugStyle.Trace: |
| 59 | console.trace(); |
| 60 | logDebug(data, DebugStyle.Error); |
| 61 | break; |
| 62 | } |
| 63 | }; |
no outgoing calls
no test coverage detected