e1.2.1 Readme update and comment cleanup.

This commit is contained in:
lixen committed 2025-04-24 15:31:49 -04:00
1 parent bfed212f40
commit 764caeb894
8 files changed
+118 -134

No files matched your search

+1 -2
View File
@@ -341,7 +341,6 @@ func (l *Logger) createNewLogFile() (*os.File, error) {
filename := l.generateLogFileName(time.Now())
fullPath := filepath.Join(dir, filename)
// Retry logic for potential collisions (rare)
for i := 0; i < 5; i++ {
if _, err := os.Stat(fullPath); os.IsNotExist(err) {
break
@@ -366,7 +365,7 @@ func (l *Logger) rotateLogFile() error {
}
oldFilePtr := l.state.CurrentFile.Swap(newFile)
l.state.CurrentSize.Store(0) // Reset size for the new file
l.state.CurrentSize.Store(0)
if oldFilePtr != nil {
if oldFile, ok := oldFilePtr.(*os.File); ok && oldFile != nil {