CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/hub/logger.ts
Views: 687
1
/*
2
Winston logger for a hub server.
3
4
There is a similar logger, but with different parameters, in packages/project.
5
*/
6
7
import { getLogger } from "@cocalc/backend/logger";
8
9
// either way:
10
export { getLogger };
11
export default getLogger;
12
13
import { setCounter } from "@cocalc/backend/logger";
14
15
const metrics_recorder = require("./metrics-recorder");
16
17
// one metric for all WinstonMetrics instances (instead, they have a name and the level!)
18
const counter = metrics_recorder.new_counter(
19
"log_lines_total",
20
"counts the number of printed log lines",
21
["name", "level"]
22
);
23
24
setCounter(counter);
25
26