code: function resolveLoggingFunction(logger, loggingFnName, useLogLevelPrefix, logLevelPrefix) {
    // Bind the relevant log function to its appropriate logger
    const loggingFn = logger[loggingFnName].bind(logger);
  
    // Note that we skip adding a prefix when using console.trace, since it already includes its own prefix 'Trace: '
    if (!useLogLevelPrefix || (logger === console && loggingFnName === 'trace')) {
      return loggingFn;
    }
  
    function logWithPrefix() {
      if (arguments.length > 0) {
        const arg0 = arguments[0];
        if (!isString(arg0) || !arg0.startsWith(logLevelPrefix)) {
          arguments[0] = `${logLevelPrefix} ${arg0 instanceof Error && arg0.stack ? arg0.stack : arg0}`;
        }
      }
      return loggingFn.apply(null, arguments); // prior bind takes precedence over any apply (so just apply with null)
    }
  
    return logWithPrefix;
  }
docs: Resolves the given logger's named logging function, binds it to the given logger and then either returns the bound
  function (if `useLogLevelPrefix` is false) or wraps it in a function that will also prepend the given
  `logLevelPrefix` to any first argument before invoking the bound function.
  @param {Logger|BasicLogger} logger - the underlying logger from which the logging function originates
  @param {string} loggingFnName - the name of the logger's logging function to use
  @param {boolean} useLogLevelPrefix - whether the returned function must prepend the given log-level prefix to its first argument or not
  @param {string} logLevelPrefix - the prefix to prepend
  @return {logWithPrefix} a bound and possibly prefix pre-pending logging function that delegates to the named & bound logging function