logger

package
v1.2.10 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldChannel  = "channel"
	FieldChatID   = "chat_id"
	FieldSenderID = "sender_id"
	FieldPreview  = "preview"
	FieldError    = "error"

	FieldMessageContentLength      = "message_content_length"
	FieldAssistantContentLength    = "assistant_content_length"
	FieldUserResponseContentLength = "user_response_content_length"
	FieldFetchedContentLength      = "fetched_content_length"
	FieldOutputContentLength       = "output_content_length"
	FieldTranscriptLength          = "transcript_length"
)

Variables

This section is empty.

Functions

func Debug

func Debug(code CodeID)

func DebugC

func DebugC(component string, code CodeID)

func DebugCF

func DebugCF(component string, code CodeID, fields map[string]interface{})

func DebugF

func DebugF(code CodeID, fields map[string]interface{})

func DisableFileLogging

func DisableFileLogging()

func EnableFileLogging

func EnableFileLogging(filePath string) error

func EnableFileLoggingWithRotation

func EnableFileLoggingWithRotation(filePath string, maxSizeMB, maxAgeDays int) error

func Error

func Error(code CodeID)

func ErrorC

func ErrorC(component string, code CodeID)

func ErrorCF

func ErrorCF(component string, code CodeID, fields map[string]interface{})

func ErrorF

func ErrorF(code CodeID, fields map[string]interface{})

func Fatal

func Fatal(code CodeID)

func FatalC

func FatalC(component string, code CodeID)

func FatalCF

func FatalCF(component string, code CodeID, fields map[string]interface{})

func FatalF

func FatalF(code CodeID, fields map[string]interface{})

func Info

func Info(code CodeID)

func InfoC

func InfoC(component string, code CodeID)

func InfoCF

func InfoCF(component string, code CodeID, fields map[string]interface{})

func InfoF

func InfoF(code CodeID, fields map[string]interface{})

func SetLevel

func SetLevel(level LogLevel)

func Warn

func Warn(code CodeID)

func WarnC

func WarnC(component string, code CodeID)

func WarnCF

func WarnCF(component string, code CodeID, fields map[string]interface{})

func WarnF

func WarnF(code CodeID, fields map[string]interface{})

Types

type CodeID

type CodeID int
const (
	C0001 CodeID = iota + 1
	C0002
	C0003
	C0004
	C0005
	C0006
	C0007
	C0008
	C0009
	C0010
	C0011
	C0012
	C0013
	C0014
	C0015
	C0016
	C0017
	C0018
	C0019
	C0020
	C0021
	C0022
	C0023
	C0024
	C0025
	C0026
	C0027
	C0028
	C0029
	C0030
	C0031
	C0032
	C0033
	C0034
	C0035
	C0036
	C0037
	C0038
	C0039
	C0040
	C0041
	C0042
	C0043
	C0044
	C0045
	C0046
	C0047
	C0048
	C0049
	C0050
	C0051
	C0052
	C0053
	C0054
	C0055
	C0056
	C0057
	C0058
	C0059
	C0060
	C0061
	C0062
	C0063
	C0064
	C0065
	C0066
	C0067
	C0068
	C0069
	C0070
	C0071
	C0072
	C0073
	C0074
	C0075
	C0076
	C0077
	C0078
	C0079
	C0080
	C0081
	C0082
	C0083
	C0084
	C0085
	C0086
	C0087
	C0088
	C0089
	C0090
	C0091
	C0092
	C0093
	C0094
	C0095
	C0096
	C0097
	C0098
	C0099
	C0100
	C0101
	C0102
	C0103
	C0104
	C0105
	C0106
	C0107
	C0108
	C0109
	C0110
	C0111
	C0112
	C0113
	C0114
	C0115
	C0116
	C0117
	C0118
	C0119
	C0120
	C0121
	C0122
	C0123
	C0124
	C0125
	C0126
	C0127
	C0128
	C0129
	C0130
	C0131
	C0132
	C0133
	C0134
	C0135
	C0136
	C0137
	C0138
	C0139
	C0140
	C0141
	C0142
	C0143
	C0144
	C0145
	C0146
	C0147
	C0148
	C0149
	C0150
	C0151
	C0152
	C0153
	C0154
	C0155
	C0156
	C0157
	C0158
	C0159
	C0160
	C0161
	C0162
	C0163
	C0164
	C0165
	C0166
	C0167
	C0168
	C0169
	C0170
	C0171
	C0172
	C0173
)

type LogEntry

type LogEntry struct {
	Level     string                 `json:"level"`
	Timestamp string                 `json:"timestamp"`
	Component string                 `json:"component,omitempty"`
	Code      int                    `json:"code,omitempty"`
	Message   string                 `json:"message,omitempty"`
	Fields    map[string]interface{} `json:"fields,omitempty"`
	Caller    string                 `json:"caller,omitempty"`
}

type LogLevel

type LogLevel int
const (
	DEBUG LogLevel = iota
	INFO
	WARN
	ERROR
	FATAL
)

func GetLevel

func GetLevel() LogLevel

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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