Skip to content

Commit

Permalink
fix(logger): fix log rotation error, fix #326
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed May 10, 2024
1 parent 22b4848 commit 02bc617
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/logger/package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
1 change: 1 addition & 0 deletions plugins/logger/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 02bc617

Please sign in to comment.