Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Close ¶
func Close() error
Close closes the underlying log file if it is open.
It should be called when the application is shutting down to ensure that all buffered log data is flushed and the file descriptor is released.
func Error ¶
func Error(format string, args ...interface{})
Error logs an error message using printf-style formatting.
Use this for error conditions and failures that should be visible in application logs.
func Info ¶
func Info(format string, args ...interface{})
Info logs an informational message using printf-style formatting.
The format string and arguments are passed to fmt.Sprintf and the resulting string is logged with INFO level.
func InitLogger ¶
InitLogger initializes the global logger with the given log file path.
The function ensures that the directory for the log file exists, creates it if necessary, and then opens the log file for appending. If the logger is successfully initialized, subsequent logging functions (Info, Warn, Error) will write to this file.