// openFile opens the log file.
openFile opens the log file.
// openFile opens the log file .
func (l *FileLogger) openFile() error {
	filename := fmt.Sprintf("%s/%s.log", l.path, l.filename)
	if l.daily {
		filename = fmt.Sprintf("%s/%s-%s.log", l.path, l.filename, l.date)
	}
	file, err := os.OpenFile(filename, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0644)
	if err != nil {
		return fmt.Errorf("error opening file: %w", err)
	}
	l.file = file
	return nil
}
func ( l * FileLogger ) openFile ( ) error { filename := fmt . Sprintf ( " " , l . path , l . filename ) if l . daily { filename = fmt . Sprintf ( " " , l . path , l . filename , l . date ) } file , err := os . OpenFile ( filename , os . O_RDWR | os . O_CREATE | os . O_APPEND , 0644 ) if err != nil { return fmt . Errorf ( " " , err ) } l . file = file return nil }
openFile opens the log file.
openFile opens the log file .