Documentation
¶
Index ¶
Constants ¶
View Source
const ( LogLevelDebug = logger.LevelDebug LogLevelInfo = logger.LevelInfo LogLevelWarn = logger.LevelWarn LogLevelError = logger.LevelError )
Log level constants for configuring the logger.
Variables ¶
This section is empty.
Functions ¶
func ConfigureLogger ¶
func ConfigureLogger(opts *LoggerOptions)
ConfigureLogger sets up the global logger with the provided options. If opts is nil, default settings are used (Info level, text format, stderr output).
Example:
// Enable debug logging
irapi.ConfigureLogger(&irapi.LoggerOptions{
Level: irapi.LogLevelDebug,
})
// Enable JSON logging to a custom writer
irapi.ConfigureLogger(&irapi.LoggerOptions{
Level: irapi.LogLevelInfo,
Output: myWriter,
JSON: true,
})
func DisableLogging ¶
func DisableLogging()
DisableLogging silences all log output from the iRacing API client.
Types ¶
type IRacingApiClient ¶
type IRacingApiClient struct {
Client *client.ApiClient
Car *car.CarApi
Carclass *carclass.CarclassApi
Constants *constants.ConstantsApi
DriverStatsByCategory *driver_stats_by_category.DriverStatsByCategoryApi
Hosted *hosted.HostedApi
League *league.LeagueApi
Lookup *lookup.LookupApi
Member *member.MemberApi
Results *results.ResultsApi
Season *season.SeasonApi
Series *series.SeriesApi
Session *session.SessionApi
Stats *stats.StatsApi
Team *team.TeamApi
TimeAttack *time_attack.TimeAttackApi
Track *track.TrackApi
}
func NewIRacingPasswordLimitedApiClient ¶
func NewIRacingPasswordLimitedApiClient(clientId, clientSecret, username, password string) (*IRacingApiClient, error)
type LoggerOptions ¶
type LoggerOptions struct {
// Level sets the minimum log level to output. Messages below this level are discarded.
// Default is LogLevelInfo.
Level LogLevel
// Output sets the destination for log output. Defaults to os.Stderr if nil.
Output io.Writer
// JSON enables JSON-formatted output when true. Defaults to text format.
JSON bool
}
LoggerOptions configures the logger behavior.
Click to show internal directories.
Click to hide internal directories.