33 lines
911 B
TypeScript
33 lines
911 B
TypeScript
|
|
// Copyright (C) 2026 Whiterun LLC,
|
||
|
|
// This software is licensed under the GNU Lesser General Public License (LGPL), version 3.0 or later.
|
||
|
|
// A copy of the license can be found in the LICENSE file or at https://www.gnu.org/licenses/lgpl-3.0.html
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Simple console-based logger shim.
|
||
|
|
* Replaces @riftenlabs/log without any external dependencies.
|
||
|
|
*/
|
||
|
|
|
||
|
|
export enum Scope {
|
||
|
|
Relay = "relay",
|
||
|
|
Network = "network",
|
||
|
|
Misc = "misc",
|
||
|
|
}
|
||
|
|
|
||
|
|
export type LogScope = Scope | string;
|
||
|
|
|
||
|
|
export function debug(scope: LogScope, ...args: unknown[]): void {
|
||
|
|
console.log(`[${scope}]`, ...args);
|
||
|
|
}
|
||
|
|
|
||
|
|
export function info(scope: LogScope, ...args: unknown[]): void {
|
||
|
|
console.info(`[${scope}]`, ...args);
|
||
|
|
}
|
||
|
|
|
||
|
|
export function warn(scope: LogScope, ...args: unknown[]): void {
|
||
|
|
console.warn(`[${scope}]`, ...args);
|
||
|
|
}
|
||
|
|
|
||
|
|
export function error(scope: LogScope, ...args: unknown[]): void {
|
||
|
|
console.error(`[${scope}]`, ...args);
|
||
|
|
}
|