Add some logging related stubs to express backend
This commit is contained in:
@@ -6,6 +6,10 @@ const { values } = parseArgs({
|
|||||||
type: "string",
|
type: "string",
|
||||||
short: "l",
|
short: "l",
|
||||||
},
|
},
|
||||||
|
"log-address": {
|
||||||
|
type: "string",
|
||||||
|
default: "8085",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
strict: true,
|
strict: true,
|
||||||
allowPositionals: false,
|
allowPositionals: false,
|
||||||
@@ -43,7 +47,9 @@ function parseListenAddress(listen: string | undefined): {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const listenAddress = parseListenAddress(values.listen);
|
const listenAddress = parseListenAddress(values.listen);
|
||||||
|
const logAddress = parseListenAddress(values["log-address"]);
|
||||||
|
|
||||||
export const cli = {
|
export const cli = {
|
||||||
listen: listenAddress,
|
listen: listenAddress,
|
||||||
|
logAddress,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
// internal-logging.ts
|
// internal-logging.ts
|
||||||
|
|
||||||
|
import { cli } from "./cli";
|
||||||
|
|
||||||
// FIXME: Move this to somewhere more appropriate
|
// FIXME: Move this to somewhere more appropriate
|
||||||
type AtLeastOne<T> = [T, ...T[]];
|
type AtLeastOne<T> = [T, ...T[]];
|
||||||
|
|
||||||
@@ -32,6 +34,9 @@ type FilterArgument = {
|
|||||||
|
|
||||||
const log = (_message: Message) => {
|
const log = (_message: Message) => {
|
||||||
// WRITEME
|
// WRITEME
|
||||||
|
console.log(
|
||||||
|
`will POST a message to ${cli.logAddress.host}:${cli.logAddress.port}`,
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getLogs = (filter: FilterArgument) => {
|
const getLogs = (filter: FilterArgument) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user