docs: function _configureLogging(target, settings) {
    const envLogLevelName = settings.envLogLevelName;
  
    // If a logLevel is configured in the named environment variable then use it instead
    const envLogLevel = process.env[envLogLevelName];
    const logLevel = isValidLogLevel(envLogLevel) ? cleanLogLevel(envLogLevel) : settings.logLevel;
  
    const useLevelPrefixes = settings.useLevelPrefixes;
    const useConsoleTrace = settings.useConsoleTrace;
    const logger = isMinimumViableLogger(settings.underlyingLogger) ? settings.underlyingLogger : console;
  
    // Finalise the underlying logging methods to be used
    const usingConsole = logger === console;
    const hasInfoMethod = usingConsole || typeof logger.info === 'function';
    const hasLogMethod = usingConsole || typeof logger.log === 'function';
  
    if (!hasLogMethod && !hasInfoMethod) {
      throw new Error(`FATAL: Cannot configure logging with an underlying logger that has neither a log method nor an info method - logger (${stringify(logger)})`);
    }
    if (!hasLogMethod) {
      console.warn('WARNING - The configured underlying logger has NO log method - falling back to using its info method');
    }
    if (!hasInfoMethod) {
      console.warn('WARNING - The configured underlying logger has NO info method - falling back to using its log method');
    }
  
    // Use log level to determine which levels are enabled
    const traceEnabled = logLevel === LogLevel.TRACE;
    const debugEnabled = traceEnabled || logLevel === LogLevel.DEBUG;
    const infoEnabled = debugEnabled || logLevel === LogLevel.INFO;
    const warnEnabled = infoEnabled || logLevel === LogLevel.WARN;
  
    // Resolve logger's error method
    const error = resolveLoggingFunction(logger, 'error', useLevelPrefixes, 'ERROR');
  
    // Resolve logger's warn method, but fallback to using logger.error if it has no logger.warn method
    const warnFnName = usingConsole ? 'warn' : typeof logger.warn === 'function' ? 'warn' : 'error';
    const warn = warnEnabled ? resolveLoggingFunction(logger, warnFnName, useLevelPrefixes, 'WARN') : noop;
  
    // Resolve logger's info method, but fallback to using logger.log if it has no logger.info
    const infoFnName = usingConsole ? 'info' : typeof logger.info === 'function' ? 'info' : 'log';
    const info = infoEnabled ? resolveLoggingFunction(logger, infoFnName, useLevelPrefixes, 'INFO') : noop;
  
    // Resolve logger's debug method, but fallback to using infoFnName if it has no logger.debug method
    const debugFnName = usingConsole ? 'info' : typeof logger.debug === 'function' ? 'debug' : infoFnName;
    const debug = debugEnabled ? resolveLoggingFunction(logger, debugFnName, useLevelPrefixes, 'DEBUG') : noop;
  
    // Resolve logger's trace method, but fallback to using debugFnName if it has no logger.trace method
    const traceFnName = usingConsole ? useConsoleTrace ? 'trace' : 'info' :
      typeof logger.trace === 'function' ? 'trace' : debugFnName;
    const trace = traceEnabled ? resolveLoggingFunction(logger, traceFnName, useLevelPrefixes, 'TRACE') : noop;
  
    // Resolve logger's log method, but fallback to using logger.info if it has no logger.log method, which is NOT
    // technically a proper replacement for a log method, but nevertheless ...
    // To enable the underlying logger's log method's output to ALSO be suppressed, treat it as if it logs at INFO level
    // (i.e. it will be suppressed if infoEnabled is false), but prefix it with 'LOG' instead of 'INFO' (to distinguish it
    // from INFO logging output) when useLevelPrefixes is true
    const logFnName = usingConsole ? 'log' : typeof logger.log === 'function' ? 'log' : infoFnName;
    const log = infoEnabled ? resolveLoggingFunction(logger, logFnName, useLevelPrefixes, 'LOG') : noop;
  
    // Add the logging functionality to the given target object
    target.logLevel = logLevel; // for info and testing purposes
    target._underlyingLogger = logger; // for testing purposes ONLY
    target.warnEnabled = warnEnabled;
    target.infoEnabled = infoEnabled;
    target.debugEnabled = debugEnabled;
    target.traceEnabled = traceEnabled;
    target.error = error;
    target.warn = warn;
    target.info = info;
    target.debug = debug;
    target.trace = trace;
    target.log = extendLogFunction(target, log);
  
    target.debug(`Logging configured with level ${logLevel}, with${useLevelPrefixes ? '' : 'out'} prefixes, with env log level name '${envLogLevelName}' & with${useConsoleTrace ? '' : 'out'} console.trace`);
  
    return target;
  }