@@ -17,7 +17,6 @@ describe('startup logging', () => {
1717 let tracerInfoMethod
1818
1919 before ( ( ) => {
20- sinon . stub ( console , 'info' )
2120 sinon . stub ( console , 'warn' )
2221 delete require . cache [ require . resolve ( '../src/startup-log' ) ]
2322 const {
@@ -60,13 +59,10 @@ describe('startup logging', () => {
6059 ] )
6160 // Use sinon's stub instance directly to avoid type errors
6261 // eslint-disable-next-line no-console
63- const infoStub = /** @type {sinon.SinonStub } */ ( console . info )
64- // eslint-disable-next-line no-console
6562 const warnStub = /** @type {sinon.SinonStub } */ ( console . warn )
6663 startupLog ( { message : 'Error: fake error' } )
67- firstStderrCall = infoStub . firstCall
68- secondStderrCall = warnStub . firstCall
69- infoStub . restore ( )
64+ firstStderrCall = warnStub . firstCall
65+ secondStderrCall = warnStub . secondCall
7066 warnStub . restore ( )
7167 } )
7268
@@ -114,7 +110,7 @@ describe('data_streams_enabled', () => {
114110 } )
115111
116112 it ( 'should be true when env var is true and config is unset' , ( ) => {
117- sinon . stub ( console , 'info ' )
113+ sinon . stub ( console , 'warn ' )
118114 delete require . cache [ require . resolve ( '../src/startup-log' ) ]
119115 const {
120116 setStartupLogConfig,
@@ -127,14 +123,14 @@ describe('data_streams_enabled', () => {
127123 setStartupLogPluginManager ( { _pluginsByName : { } } )
128124 startupLog ( )
129125 /* eslint-disable-next-line no-console */
130- const infoStub = /** @type {sinon.SinonStub } */ ( console . info )
131- const logObj = JSON . parse ( infoStub . firstCall . args [ 0 ] . replace ( 'DATADOG TRACER CONFIGURATION - ' , '' ) )
132- infoStub . restore ( )
126+ const warnStub = /** @type {sinon.SinonStub } */ ( console . warn )
127+ const logObj = JSON . parse ( warnStub . firstCall . args [ 0 ] . replace ( 'DATADOG TRACER CONFIGURATION - ' , '' ) )
128+ warnStub . restore ( )
133129 assert . strictEqual ( logObj . data_streams_enabled , true )
134130 } )
135131
136132 it ( 'should be true when env var is not set and config is true' , ( ) => {
137- sinon . stub ( console , 'info ' )
133+ sinon . stub ( console , 'warn ' )
138134 delete require . cache [ require . resolve ( '../src/startup-log' ) ]
139135 const {
140136 setStartupLogConfig,
@@ -147,14 +143,14 @@ describe('data_streams_enabled', () => {
147143 setStartupLogPluginManager ( { _pluginsByName : { } } )
148144 startupLog ( )
149145 /* eslint-disable-next-line no-console */
150- const infoStub = /** @type {sinon.SinonStub } */ ( console . info )
151- const logObj = JSON . parse ( infoStub . firstCall . args [ 0 ] . replace ( 'DATADOG TRACER CONFIGURATION - ' , '' ) )
152- infoStub . restore ( )
146+ const warnStub = /** @type {sinon.SinonStub } */ ( console . warn )
147+ const logObj = JSON . parse ( warnStub . firstCall . args [ 0 ] . replace ( 'DATADOG TRACER CONFIGURATION - ' , '' ) )
148+ warnStub . restore ( )
153149 assert . strictEqual ( logObj . data_streams_enabled , true )
154150 } )
155151
156152 it ( 'should be false when env var is true but config is false' , ( ) => {
157- sinon . stub ( console , 'info ' )
153+ sinon . stub ( console , 'warn ' )
158154 delete require . cache [ require . resolve ( '../src/startup-log' ) ]
159155 const {
160156 setStartupLogConfig,
@@ -167,9 +163,9 @@ describe('data_streams_enabled', () => {
167163 setStartupLogPluginManager ( { _pluginsByName : { } } )
168164 startupLog ( )
169165 /* eslint-disable-next-line no-console */
170- const infoStub = /** @type {sinon.SinonStub } */ ( console . info )
171- const logObj = JSON . parse ( infoStub . firstCall . args [ 0 ] . replace ( 'DATADOG TRACER CONFIGURATION - ' , '' ) )
172- infoStub . restore ( )
166+ const warnStub = /** @type {sinon.SinonStub } */ ( console . warn )
167+ const logObj = JSON . parse ( warnStub . firstCall . args [ 0 ] . replace ( 'DATADOG TRACER CONFIGURATION - ' , '' ) )
168+ warnStub . restore ( )
173169 assert . strictEqual ( logObj . data_streams_enabled , false )
174170 } )
175171} )
@@ -183,7 +179,7 @@ describe('profiling_enabled', () => {
183179 [ 'auto' , true ] ,
184180 [ 'true' , true ] ,
185181 ] . forEach ( ( [ envVar , expected ] ) => {
186- sinon . stub ( console , 'info ' )
182+ sinon . stub ( console , 'warn ' )
187183 delete require . cache [ require . resolve ( '../src/startup-log' ) ]
188184 const {
189185 setStartupLogConfig,
@@ -196,9 +192,9 @@ describe('profiling_enabled', () => {
196192 setStartupLogPluginManager ( { _pluginsByName : { } } )
197193 startupLog ( )
198194 /* eslint-disable-next-line no-console */
199- const infoStub = /** @type {sinon.SinonStub } */ ( console . info )
200- const logObj = JSON . parse ( infoStub . firstCall . args [ 0 ] . replace ( 'DATADOG TRACER CONFIGURATION - ' , '' ) )
201- infoStub . restore ( )
195+ const warnStub = /** @type {sinon.SinonStub } */ ( console . warn )
196+ const logObj = JSON . parse ( warnStub . firstCall . args [ 0 ] . replace ( 'DATADOG TRACER CONFIGURATION - ' , '' ) )
197+ warnStub . restore ( )
202198 assert . strictEqual ( logObj . profiling_enabled , expected )
203199 } )
204200 } )
0 commit comments