When logging something requires expensive operations, it would be nice to be able to skip the work if it won't be logged.
For example, instead of:
```
let serializedComplexObject = expensiveOp();
logConsole.trace(serializedComplexObject);
```
one could do:
```
if (logConsole.logLevelAtLeast("Trace")) {
let serializedComplexObject = expensiveOp();
logConsole.trace(serializedComplexObject);
}
```
Bug 1862989 Comment 0 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Using `console.createInstance`.
When logging something requires expensive operations, it would be nice to be able to skip the work if it won't be logged.
For example, instead of:
```
let serializedComplexObject = expensiveOp();
logConsole.trace(serializedComplexObject);
```
one could do:
```
if (logConsole.logLevelAtLeast("Trace")) {
let serializedComplexObject = expensiveOp();
logConsole.trace(serializedComplexObject);
}
```