Commit Graph

8 Commits

Author SHA1 Message Date
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 107b8f3050 add doc 2025-06-06 19:38:01 +08:00
程广 b5ea719c56 file appender添加滚动设置,appender添加formatter设置 2025-06-06 11:07:04 +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
程广 bde229321f refactor 2023-11-29 10:16:56 +08:00
程广 97ba3d3215 add file appender 2023-11-28 18:31:45 +08:00