jstests/core/apitest_db_profile_level.js
// Checks for the log that was expected to be created when profile level changed.
Checks for the log that was expected to be created when profile level changed.
Checks for the log that was expected to be created when profile level changed .
function profilerChangeWasLogged({from, to} = {}) {
    const globalLog = assert.commandWorked(profileLevelDB.adminCommand({getLog: 'global'}));
    const fieldMatcher = {msg: "Profiler settings changed"};
    if (from && to) {
        const lines = [...findMatchingLogLines(globalLog.log, fieldMatcher)];
        return lines.find(line => line.match(new RegExp(/"from":{/.source + from.source)) &&
                              line.match(new RegExp(/"to":{/.source + to.source)));
    } else {
        return findMatchingLogLine(globalLog.log, fieldMatcher);
    }
}
function profilerChangeWasLogged ( { from , to } = { } ) { const globalLog = assert . commandWorked ( profileLevelDB . adminCommand ( { getLog : 'global' } ) ) ; const fieldMatcher = { msg : "Profiler settings changed" } ; if ( from && to ) { const lines = [ ... findMatchingLogLines ( globalLog . log , fieldMatcher ) ] ; return lines . find ( line => line . match ( new RegExp ( / "from":{ / . source + from . source ) ) && line . match ( new RegExp ( / "to":{ / . source + to . source ) ) ) ; } else { return findMatchingLogLine ( globalLog . log , fieldMatcher ) ; } }
Checks for the log that was expected to be created when profile level changed.
Checks for the log that was expected to be created when profile level changed .