This commit is contained in:
2025-08-18 21:51:28 -04:00
parent 1eb0637d38
commit f3ecb8c35b
19 changed files with 179 additions and 646 deletions

View File

@@ -65,7 +65,7 @@ export class Logger {
const timestamp = new Date().toISOString();
const formattedMessage = this.formatMessage(message, ...optionalParameters);
const levelString = LoggingLevelMapping.convertLoggingLevelToLoggingLevelType(level);
// Safely call appenders with error handling
this._appenders.forEach(appender => {
try {
@@ -86,22 +86,23 @@ export class Logger {
// More efficient parameter substitution
let result = message;
let paramIndex = 0;
// Replace all {} placeholders with parameters
while (result.includes('{}') && paramIndex < optionalParameters.length) {
const paramString = this.parameterToString(optionalParameters[paramIndex]);
result = result.replace('{}', paramString);
paramIndex++;
}
// Append remaining parameters if any
if (paramIndex < optionalParameters.length) {
const remainingParams = optionalParameters.slice(paramIndex)
const remainingParams = optionalParameters
.slice(paramIndex)
.map(param => this.parameterToString(param))
.join(' ');
result += ` ${remainingParams}`;
}
return result;
}