@@ -158,4 +158,47 @@ describe('DatabaseClient convenience methods runtime validation', function() {
158158 results [ 0 ] . should . have . property ( 'value' ) ;
159159 results [ 0 ] . value . should . be . a . String ( ) ;
160160 } ) ;
161+
162+
163+
164+ it ( 'should use setLogger with a level string' , async function ( ) {
165+ // Set logger to 'info' level
166+ client . setLogger ( 'info' ) ;
167+
168+ // Write a test document
169+ await client . documents . write ( {
170+ uri : '/test-typescript/setlogger-test.json' ,
171+ content : { test : 'setLogger' }
172+ } ) . result ( ) ;
173+
174+ // Verify client is still functional after setting logger
175+ const exists = await client . probe ( '/test-typescript/setlogger-test.json' ) . result ( ) ;
176+ exists . should . be . a . Boolean ( ) ;
177+ exists . should . equal ( true ) ;
178+ } ) ;
179+
180+ it ( 'should use setLogger with a logger object' , async function ( ) {
181+ // Create a simple logger object
182+ const testLogger = {
183+ debug : ( msg : string ) => console . log ( 'DEBUG:' , msg ) ,
184+ info : ( msg : string ) => console . log ( 'INFO:' , msg ) ,
185+ warn : ( msg : string ) => console . log ( 'WARN:' , msg ) ,
186+ error : ( msg : string ) => console . log ( 'ERROR:' , msg )
187+ } ;
188+
189+ // Set logger with object
190+ client . setLogger ( testLogger , false ) ;
191+
192+ // Write a test document
193+ await client . documents . write ( {
194+ uri : '/test-typescript/setlogger-test2.json' ,
195+ content : { test : 'setLogger with object' }
196+ } ) . result ( ) ;
197+
198+ // Verify client is still functional after setting logger
199+ const exists = await client . probe ( '/test-typescript/setlogger-test2.json' ) . result ( ) ;
200+ exists . should . be . a . Boolean ( ) ;
201+ exists . should . equal ( true ) ;
202+ } ) ;
203+
161204} ) ;
0 commit comments