logger

package
v0.5.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

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

func GetNewTraceFile(repoID string) string

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

func InitializeTraceLogger(filePath string) (err error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL