mirror of
https://github.com/TheBinaryNinja/tvapp2.git
synced 2026-06-12 03:05:41 -04:00
initial push from external dev branches
This commit is contained in:
18
server/dist/sources/core/logger.js
vendored
Normal file
18
server/dist/sources/core/logger.js
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
// Tiny tagged logger matching the existing console style ("[mongo] connected", "[api] …").
|
||||
// Ported from d-combine/lib/core/logger.mjs, trimmed to what the core uses.
|
||||
function emit(level, tag, msg) {
|
||||
const line = `[${tag}] ${msg}`;
|
||||
if (level === 'error')
|
||||
console.error(line);
|
||||
else if (level === 'warn')
|
||||
console.warn(line);
|
||||
else
|
||||
console.info(line);
|
||||
}
|
||||
export const logger = {
|
||||
info: (tag, msg) => emit('info', tag, msg),
|
||||
warn: (tag, msg) => emit('warn', tag, msg),
|
||||
error: (tag, msg) => emit('error', tag, msg),
|
||||
ok: (tag, msg) => emit('ok', tag, msg),
|
||||
};
|
||||
//# sourceMappingURL=logger.js.map
|
||||
Reference in New Issue
Block a user