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.
@@ -223,7 +224,7 @@ export function createConsolaReporter(options: ConsolaReporterOptions = {}): Con
223224
224225 // Build attributes: `rest` properties from logObj get a "consola" prefix; base attributes added below may override
225226 for ( const [ key , value ] of Object . entries ( rest ) ) {
226- attributes [ `consola.${ key } ` ] = value ;
227+ attributes [ `consola.${ key } ` ] = normalize ( value , normalizeDepth , normalizeMaxBreadth ) ;
227228 }
228229
229230 // Build attributes
Original file line number Diff line number Diff line change @@ -319,7 +319,7 @@ describe('createConsolaReporter', () => {
319319 userId : 123 ,
320320 action : 'login' ,
321321 time : '2026-02-24T10:24:04.477Z' ,
322- smallObj : { word : 'hi' } ,
322+ smallObj : { firstLevel : { secondLevel : { thirdLevel : { fourthLevel : 'deep' } } } } ,
323323 tag : '' ,
324324 } ) ;
325325
@@ -331,7 +331,7 @@ describe('createConsolaReporter', () => {
331331 'consola.type' : 'log' ,
332332 'consola.level' : 2 ,
333333 'consola.userId' : 123 ,
334- 'consola.smallObj' : { word : 'hi ' } ,
334+ 'consola.smallObj' : { firstLevel : { secondLevel : { thirdLevel : '[Object] ' } } } , // Object is normalized
335335 'consola.action' : 'login' ,
336336 'consola.time' : '2026-02-24T10:24:04.477Z' ,
337337 'sentry.origin' : 'auto.log.consola' ,
You can’t perform that action at this time.
0 commit comments