small changes

This commit is contained in:
Strix 2022-05-07 17:01:19 +02:00
parent ce0e6a1333
commit cd52e15ce5
Signed by untrusted user who does not match committer: didier
GPG key ID: 01E71F18AA4398E5

View file

@ -12,8 +12,8 @@ class Logger {
* onHistoryFull: () => void,
* argsPlaceholder: string,
* dict: {[key: string]: string}
* logFrom: string
* logFrom2: string
* logFrom: 'debug' | 'info' | 'warn' | 'error' | 'fatal'
* logFrom2: 'debug' | 'info' | 'warn' | 'error' | 'fatal'
* }} options
*/
constructor(options = {})
@ -38,8 +38,8 @@ class Logger {
this.alog("warn;", "History is full, dropping 25 oldest entries.");
this.history = this.history.slice(25);
};
this.logFrom = options.logFrom || "D"; // when to stop logging to output
this.logFrom2 = options.logFrom2 || "D"; // when to stop logging to output2
this.logFrom = options.logFrom ? options.logFrom.charAt(0).toUpperCase() : "D"; // when to stop logging to output
this.logFrom2 = options.logFrom2 ? options.logFrom2.charAt(0).toUpperCase() : "D"; // when to stop logging to output2
// Order from least important to most: D, I, W, E, F
this.logImportance = {
D: 0, I: 1, W: 2, E: 3, F: 4