Commit Graph

34 Commits

Author SHA1 Message Date
kingecg 36b2fe9f34 ```
feat(logger): add maxCount configuration option for file appender

Add support for maxCount parameter in file appender configuration.
The maxCount option allows users to specify the maximum number of
backup files to keep when log rotation is enabled.

The new configuration option defaults to 1 if not specified in the
appender options and is passed to the FileAppender struct during
initialization.
```

Co-authored-by: Copilot <copilot@github.com>
2026-07-11 08:54:19 +08:00
kingecg cdea9d86ed ```
feat(file): add thread safety and improve log rolling functionality

- Add sync.Mutex to FileAppender for thread-safe operations
- Implement proper mutex locking in start() goroutine to prevent
  race conditions during file operations
- Return boolean from checkAndRoll() method to indicate if rolling occurred
- Add MaxCount field to limit number of archived log files
- Implement cleanup of old log files exceeding MaxCount limit
- Add proper error handling for file rename operations
- Track current file size using WriteString return values

refactor(format): update formatting functions with better type safety

- Change isFormatString parameter

Co-authored-by: Copilot <copilot@github.com>
2026-07-09 21:47:03 +08:00
kingecg 8c6cf6310f chore: update module path to git.kingecg.top 2025-06-26 01:05:39 +08:00
kingecg ecd906084a chore: update module path to git.kingecg.top 2025-06-25 22:53:39 +08:00
kingecg 0c28c10c1e chore: update module path to git.kingecg.top 2025-06-25 21:56:20 +08:00
kingecg 27fcdad135 fix nil pointer error 2025-06-06 23:30:27 +08:00
kingecg 1004333534 fix 2025-06-06 20:23:06 +08:00
kingecg 107b8f3050 add doc 2025-06-06 19:38:01 +08:00
程广 42beab28a3 make it can reconfig 2025-06-06 13:55:46 +08:00
程广 b5ea719c56 file appender添加滚动设置,appender添加formatter设置 2025-06-06 11:07:04 +08:00
程广 c8e7426d2d fix code 2025-06-06 09:57:25 +08:00
kingecg 74b7feac5b 添加 LICENSE 2024-11-08 21:33:16 +08:00
kingecg 45c66585ad fix support for format 2024-10-01 15:55:21 +08:00
kingecg d13d851819 add support for format 2024-10-01 13:47:50 +08:00
kingecg 8515465587 fix test app 2024-09-21 22:41:52 +08:00
kingecg 6d89afc6e3 fix dead loop 2024-09-21 14:25:45 +08:00
kingecg 20e440f79d 增加close file code 2023-12-13 23:07:32 +08:00
kingecg a6aaaa7495 getlogger返回指针,file 改为通过协程写文件 2023-12-13 23:05:42 +08:00
kingecg 4811fbbbe5 更新 format.go 2023-12-10 00:40:49 +08:00
kingecg 5b8be57c69 更新 format.go
log 信息添加category
2023-12-10 00:40:28 +08:00
程广 bde229321f refactor 2023-11-29 10:16:56 +08:00
程广 d94313028a fix 2023-11-28 18:32:22 +08:00
程广 97ba3d3215 add file appender 2023-11-28 18:31:45 +08:00
kingecg 343bc3e4ea add logger name 2023-03-11 21:40:33 +08:00
程广 d50d4e7f1b fix format 2023-01-23 12:08:55 +08:00
程广 c4bf07cd98 fix 2023-01-23 11:48:03 +08:00
程广 2bbe9dcf05 add appender 2023-01-23 11:35:44 +08:00
程广 db847840ff fix 2023-01-23 10:39:10 +08:00
程广 14ac4e7469 add map for logger 2023-01-23 10:24:39 +08:00
程广 5b00614d99 fix get logger 2023-01-23 10:20:17 +08:00
程广 84aa021d1a correct 2023-01-23 10:09:21 +08:00
程广 65f51e3a1d mod module path 2023-01-23 10:06:42 +08:00
程广 ffe0a3e7c8 add code 2023-01-23 09:59:30 +08:00
kingecg f658dc4cf3 Initial commit 2023-01-20 14:47:21 +08:00