mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-11-20 11:36:24 +01:00
inherit log level from parent rather than defaulting to info if not set
This commit is contained in:
parent
cc916b80de
commit
e14929bd4f
@ -32,7 +32,7 @@ export class LogItem {
|
||||
/**
|
||||
* Creates a new child item and runs it in `callback`.
|
||||
*/
|
||||
wrap(labelOrValues, callback, logLevel = LogLevel.Info, filterCreator = null) {
|
||||
wrap(labelOrValues, callback, logLevel = null, filterCreator = null) {
|
||||
const item = this.child(labelOrValues, logLevel, filterCreator);
|
||||
return item.run(callback);
|
||||
}
|
||||
@ -51,7 +51,7 @@ export class LogItem {
|
||||
*
|
||||
* Hence, the child item is not returned.
|
||||
*/
|
||||
log(labelOrValues, logLevel = LogLevel.Info) {
|
||||
log(labelOrValues, logLevel = null) {
|
||||
const item = this.child(labelOrValues, logLevel, null);
|
||||
item.end = item.start;
|
||||
}
|
||||
@ -180,6 +180,9 @@ export class LogItem {
|
||||
if (this._end !== null) {
|
||||
console.trace("log item is finished, additional logs will likely not be recorded");
|
||||
}
|
||||
if (!logLevel) {
|
||||
logLevel = this.logLevel || LogLevel.Info;
|
||||
}
|
||||
const item = new LogItem(labelOrValues, logLevel, filterCreator, this._clock);
|
||||
if (this._children === null) {
|
||||
this._children = [];
|
||||
|
Loading…
Reference in New Issue
Block a user