MCPcopy
hub / github.com/Koenkk/zigbee2mqtt / cacheNamespacedLevel

Method cacheNamespacedLevel

lib/util/logger.ts:174–191  ·  view source on GitHub ↗
(namespace: string)

Source from the content-addressed store, hash-verified

172 }
173
174 private cacheNamespacedLevel(namespace: string): string {
175 let cached = namespace;
176
177 while (this.cachedNamespacedLevels[namespace] === undefined) {
178 const sep = cached.lastIndexOf(NAMESPACE_SEPARATOR);
179
180 if (sep === -1) {
181 this.cachedNamespacedLevels[namespace] = this.level;
182
183 return this.level;
184 }
185
186 cached = cached.slice(0, sep);
187 this.cachedNamespacedLevels[namespace] = this.cachedNamespacedLevels[cached];
188 }
189
190 return this.cachedNamespacedLevels[namespace];
191 }
192
193 private log(level: settings.LogLevel, messageOrLambda: string | (() => string), namespace: string): void {
194 const nsLevel = this.cacheNamespacedLevel(namespace);

Callers 1

logMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected