Refactor logging system to centralize initialization and remove printLogs parameter

🤖 Generated with [OpenCode](https://opencode.ai)

Co-Authored-By: OpenCode <noreply@opencode.ai>
This commit is contained in:
Dax Raad
2025-06-09 14:52:30 -04:00
parent 3c23b92bea
commit d8510ab452
5 changed files with 76 additions and 79 deletions

View File

@@ -32,11 +32,7 @@ export namespace App {
const APP_JSON = "app.json"
async function create(input: {
cwd: string
version: string
printLogs?: boolean
}) {
async function create(input: { cwd: string; version: string }) {
const git = await Filesystem.findUp(".git", input.cwd).then((x) =>
x ? path.dirname(x) : undefined,
)
@@ -62,8 +58,6 @@ export namespace App {
}
>()
if (!input.printLogs) await Log.file(path.join(data, "log"))
const info: Info = {
user: os.userInfo().username,
time: {
@@ -110,7 +104,7 @@ export namespace App {
}
export async function provide<T extends (app: Info) => any>(
input: { cwd: string; version: string; printLogs?: boolean },
input: { cwd: string; version: string },
cb: T,
) {
const app = await create(input)