Reverted accidental renaming of Logger to Logging.

This commit is contained in:
Daan Vanden Bosch 2020-10-05 20:20:28 +02:00
parent bbfc4403ff
commit 6d5aca2914
4 changed files with 11 additions and 11 deletions

View File

@ -1,4 +1,4 @@
import { Logging } from "./logging";
import { Logger } from "./logging";
import { Severity } from "./Severity";
export type Result<T> = Success<T> | Failure;
@ -60,7 +60,7 @@ export function unwrap<T>(result: Result<T>): T {
export class ResultBuilder<T> {
private readonly problems: Problem[] = [];
constructor(private readonly logger: Logging) {}
constructor(private readonly logger: Logger) {}
/**
* Add a problem to the problems array and log it with {@link logger}.

View File

@ -5,7 +5,7 @@ export type LogEntry = {
readonly time: Date;
readonly message: string;
readonly severity: Severity;
readonly logger: Logging;
readonly logger: Logger;
readonly cause?: any;
};
@ -58,7 +58,7 @@ function time_part_to_string(value: number, n: number): string {
return value.toString().padStart(n, "0");
}
export class Logging {
export class Logger {
private _severity?: Severity;
get severity(): Severity {
@ -109,18 +109,18 @@ export class Logging {
}
export class LogManager {
private static readonly loggers = new Map<string, Logging>();
private static readonly loggers = new Map<string, Logger>();
static default_severity: Severity = severity_from_string(process.env["LOG_LEVEL"] ?? "Info");
static default_handler: LogHandler = default_log_handler;
static get(name: string): Logging {
static get(name: string): Logger {
name = basename(name);
let logger = this.loggers.get(name);
if (!logger) {
logger = new Logging(name);
logger = new Logger(name);
this.loggers.set(name, logger);
}

View File

@ -14,7 +14,7 @@ import { QuestObjectModel } from "./model/QuestObjectModel";
import { AreaStore } from "./stores/AreaStore";
import { InstructionPointer } from "./scripting/vm/InstructionPointer";
import { clone_segment } from "../core/data_formats/asm/instructions";
import { Logging } from "../core/logging";
import { Logger } from "../core/logging";
import { LogStore } from "./stores/LogStore";
import { Severity } from "../core/Severity";
@ -56,7 +56,7 @@ export type GameState = Readonly<GameStateInternal>;
* delegates to {@link Debugger}.
*/
export class QuestRunner {
private logger: Logging;
private logger: Logger;
private animation_frame?: number;
private startup = true;
private readonly _state: WritableProperty<QuestRunnerState> = property(

View File

@ -1,7 +1,7 @@
import { ListProperty } from "../../core/observable/property/list/ListProperty";
import { Property } from "../../core/observable/property/Property";
import { list_property, property } from "../../core/observable";
import { LogEntry, Logging, LogHandler, LogManager } from "../../core/logging";
import { LogEntry, Logger, LogHandler, LogManager } from "../../core/logging";
import { Severity } from "../../core/Severity";
import { Store } from "../../core/stores/Store";
@ -33,7 +33,7 @@ export class LogStore extends Store {
}
}
get_logger(name: string): Logging {
get_logger(name: string): Logger {
const logger = LogManager.get(name);
logger.handler = this.handler;
return logger;