Documentation
¶
Overview ¶
logger provides logging functionality for various aspects of the application, including standard logging for info and error messages, as well as logging for trace files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Info *log.Logger // Info logs general informational messages. Error *log.Logger // Error logs error messages with file and line number information. File *log.Logger // File logs messages to a specified trace file. Exercise *log.Logger // Exercise logs messages specific to an exercise with a custom prefix. )
Loggers for different purposes
Functions ¶
func GetNewTraceFile ¶
GetNewTraceFile generates a new trace file name based on the repository ID and the current timestamp.
- repoID: the unique identifier for the repository
Returns a string representing the file path for the new trace file.
func InitializeStandardLoggers ¶
func InitializeStandardLoggers(exerciseId string)
InitializeStandardLoggers initializes the Info, Error, and Exercise loggers with appropriate prefixes and output destinations.
- exerciseId: the identifier for the exercise, used in the Exercise logger's prefix
func InitializeTraceLogger ¶
InitializeTraceLogger sets up the File logger to write to the specified trace file.
- filePath: the path to the trace file to which logs should be written
Returns an error if the trace file cannot be created or opened.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.