Skip to content

Commit db94f97

Browse files
committed
feat: Add verbose logging option to CLI
1 parent 5bf17bd commit db94f97

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

src/lib/config.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
interface Config {
2-
EMULATE_STREAMING: boolean
3-
LOGGING_ENABLED: boolean
42
PORT: number
53
PORT_RANGE: [number, number]
64
}
75

86
const DEFAULT_CONFIG: Config = {
9-
EMULATE_STREAMING: false,
10-
LOGGING_ENABLED: false,
117
PORT: 4141,
128
PORT_RANGE: [4142, 4200],
139
}

src/main.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,19 @@ const main = defineCommand({
1616
default: "4141",
1717
description: "Port to listen on",
1818
},
19+
verbose: {
20+
alias: "v",
21+
type: "boolean",
22+
default: false,
23+
description: "Enable verbose logging",
24+
},
1925
},
2026
async run({ args }) {
27+
if (args.verbose) {
28+
consola.level = 5
29+
consola.info("Verbose logging enabled")
30+
}
31+
2132
const portInt = parseInt(args.port, 10)
2233

2334
const port = await initializePort(portInt)

0 commit comments

Comments
 (0)