mirror of
https://github.com/aljazceru/opencode.git
synced 2026-01-20 16:24:56 +01:00
fix log
This commit is contained in:
@@ -52,7 +52,7 @@ export namespace Log {
|
|||||||
export function file() {
|
export function file() {
|
||||||
return logpath
|
return logpath
|
||||||
}
|
}
|
||||||
let write: (msg: string) => void
|
let write = process.stderr.write
|
||||||
|
|
||||||
export async function init(options: Options) {
|
export async function init(options: Options) {
|
||||||
if (options.level) level = options.level
|
if (options.level) level = options.level
|
||||||
@@ -65,7 +65,7 @@ export namespace Log {
|
|||||||
const logfile = Bun.file(logpath)
|
const logfile = Bun.file(logpath)
|
||||||
await fs.truncate(logpath).catch(() => {})
|
await fs.truncate(logpath).catch(() => {})
|
||||||
const writer = logfile.writer()
|
const writer = logfile.writer()
|
||||||
write = (msg) => {
|
write = (msg: any) => {
|
||||||
writer.write(msg)
|
writer.write(msg)
|
||||||
writer.flush()
|
writer.flush()
|
||||||
return true
|
return true
|
||||||
|
|||||||
Reference in New Issue
Block a user