diff --git a/plugins/logger/package.json b/plugins/logger/package.json index a99715bb..65b4e64d 100644 --- a/plugins/logger/package.json +++ b/plugins/logger/package.json @@ -1,7 +1,7 @@ { "name": "@koishijs/plugin-logger", "description": "Dump log files for Koishi", - "version": "2.6.7", + "version": "2.6.8", "main": "lib/index.js", "typings": "lib/index.d.ts", "files": [ diff --git a/plugins/logger/src/index.ts b/plugins/logger/src/index.ts index 45ca313a..dafe5818 100644 --- a/plugins/logger/src/index.ts +++ b/plugins/logger/src/index.ts @@ -116,6 +116,7 @@ export async function apply(ctx: Context, config: Config) { if (writer.size >= config.maxSize) { writer.close() const index = Math.max(...files[date] ?? [0]) + 1 + files[date] ??= [] files[date].push(index) createFile(date, index) }