File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { getClient } from '../currentScopes';
33import { _INTERNAL_captureLog } from '../logs/internal' ;
44import { formatConsoleArgs } from '../logs/utils' ;
55import type { LogSeverityLevel } from '../types-hoist/log' ;
6+ import { normalize } from '../utils/normalize' ;
67
78/**
89 * Options for the Sentry Consola reporter.
@@ -230,7 +231,7 @@ export function createConsolaReporter(options: ConsolaReporterOptions = {}): Con
230231
231232 // Build attributes: `rest` properties from logObj get a "consola" prefix; base attributes added below may override
232233 for ( const [ key , value ] of Object . entries ( rest ) ) {
233- attributes [ `consola.${ key } ` ] = value ;
234+ attributes [ `consola.${ key } ` ] = normalize ( value , normalizeDepth , normalizeMaxBreadth ) ;
234235 }
235236
236237 // Build attributes
Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ describe('createConsolaReporter', () => {
217217 userId : 123 ,
218218 action : 'login' ,
219219 time : '2026-02-24T10:24:04.477Z' ,
220- smallObj : { word : 'hi' } ,
220+ smallObj : { firstLevel : { secondLevel : { thirdLevel : { fourthLevel : 'deep' } } } } ,
221221 tag : '' ,
222222 } ) ;
223223
@@ -229,7 +229,7 @@ describe('createConsolaReporter', () => {
229229 'consola.type' : 'log' ,
230230 'consola.level' : 2 ,
231231 'consola.userId' : 123 ,
232- 'consola.smallObj' : { word : 'hi ' } ,
232+ 'consola.smallObj' : { firstLevel : { secondLevel : { thirdLevel : '[Object] ' } } } , // Object is normalized
233233 'consola.action' : 'login' ,
234234 'consola.time' : '2026-02-24T10:24:04.477Z' ,
235235 'sentry.origin' : 'auto.log.consola' ,
You can’t perform that action at this time.
0 commit comments