1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-29 16:43:09 +03:00

Add more logging scopes to session IDs

This uses prefix chaining to correlate several scopes together.
This commit is contained in:
J. Ryan Stinnett
2021-02-26 17:53:39 +00:00
parent e217bf9e37
commit 8152fa44e0
4 changed files with 14 additions and 9 deletions

View File

@@ -68,8 +68,9 @@ interface PrefixedLogger extends Logger {
}
function extendLogger(logger: PrefixedLogger) {
logger.withPrefix = function(prefix: string) {
return getPrefixedLogger(this.prefix + prefix);
logger.withPrefix = function(prefix: string): PrefixedLogger {
const existingPrefix = this.prefix || "";
return getPrefixedLogger(existingPrefix + prefix);
};
}