mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-18 07:18:38 +02:00
workerscript log takes a function now, hopefully this will increase performance.
This commit is contained in:
@@ -195,14 +195,14 @@ export class WorkerScript {
|
||||
return this.disableLogs[fn] == null;
|
||||
}
|
||||
|
||||
log(func: string, txt: string): void {
|
||||
log(func: string, txt: () => string): void {
|
||||
if (this.shouldLog(func)) {
|
||||
if (func && txt) {
|
||||
this.scriptRef.log(`${func}: ${txt}`);
|
||||
this.scriptRef.log(`${func}: ${txt()}`);
|
||||
} else if (func) {
|
||||
this.scriptRef.log(func);
|
||||
} else {
|
||||
this.scriptRef.log(txt);
|
||||
this.scriptRef.log(txt());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user