mirror of
https://github.com/appium/appium.git
synced 2026-02-20 18:30:11 -06:00
fix(support): Print an empty string if no arguments are provided to a logging function (#20424)
This commit is contained in:
@@ -245,9 +245,7 @@ export class Log extends EventEmitter implements Logger {
|
||||
if (stack) {
|
||||
messageArguments.unshift(`${stack}\n`);
|
||||
}
|
||||
const formattedMessage: string = messageArguments.length
|
||||
? util.format(...messageArguments)
|
||||
: '';
|
||||
const formattedMessage = util.format(...messageArguments);
|
||||
|
||||
const m: MessageObject = {
|
||||
id: this._id++,
|
||||
|
||||
@@ -67,8 +67,12 @@ export function getLogger(prefix = null) {
|
||||
for (const level of LEVELS) {
|
||||
wrappedLogger[level] = /** @param {any[]} args */ function (...args) {
|
||||
const finalPrefix = getFinalPrefix(this.prefix, isDebugTimestampLoggingEnabled);
|
||||
// @ts-ignore This is OK
|
||||
logger[level](finalPrefix, ...args);
|
||||
if (args.length) {
|
||||
// @ts-ignore This is OK
|
||||
logger[level](finalPrefix, ...args);
|
||||
} else {
|
||||
logger[level](finalPrefix, '');
|
||||
}
|
||||
};
|
||||
}
|
||||
if (!usingGlobalLog) {
|
||||
|
||||
Reference in New Issue
Block a user