File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -1526,6 +1526,14 @@ describe('CliRepl', function () {
15261526 expect ( cliRepl . logWriter ?. isDisabled ) . equals ( true ) ;
15271527 } ) ;
15281528
1529+ it ( 'can set the log location' , function ( ) {
1530+ cliReplOptions . logLocation = './test/path' ;
1531+ cliRepl = new CliRepl ( cliReplOptions ) ;
1532+ expect ( cliRepl . logWriter ?. logFilePath ) . equals (
1533+ cliReplOptions . logLocation
1534+ ) ;
1535+ } ) ;
1536+
15291537 it ( 'sends out telemetry data for command line scripts' , async function ( ) {
15301538 cliReplOptions . shellCliOptions . eval = [ 'db.hello()' ] ;
15311539 cliRepl = new CliRepl ( cliReplOptions ) ;
Original file line number Diff line number Diff line change @@ -194,7 +194,7 @@ export class CliRepl implements MongoshIOProvider {
194194 } ) ;
195195
196196 this . logManager = new MongoLogManager ( {
197- directory : this . shellHomeDirectory . localPath ( '.' ) ,
197+ directory : options . logLocation ?? this . shellHomeDirectory . localPath ( '.' ) ,
198198 retentionDays : 30 ,
199199 maxLogFileCount : + (
200200 process . env . MONGOSH_TEST_ONLY_MAX_LOG_FILE_COUNT || 100
You can’t perform that action at this time.
0 commit comments