Documentation
¶
Index ¶
- Variables
- func ABool(args []string, index int, def bool) bool
- func AInt(args []string, index int, def int) int
- func AString(args []string, index int, def string) string
- func CheckUpdatesAndPrintInfo(version string)
- func InitLogger()
- func LineCounter(r io.Reader) (int, error)
- func LineCounterWithChannel(r io.Reader, fn func(line Line, cancel func())) error
- func LoadFile(configFilePath string) string
- func OpenFileForReading(file string) (io.Reader, int64)
- func OpenFileForReadingWithProgress(file string) (io.Reader, int64, *pb.ProgressBar)
- func PickRandom[T any](slice []T) T
- func ProcessIncomingMessages(ch chan models.Message, appendToFile string, appendToFileRaw bool) chan models.Message
- func RandStringRunes(n int) string
- func SetLoggerDiscard(discard bool)
- func SetLoggerInterceptor(fn LogInterceptor)
- func SetLoggerLevel(verbose bool)
- func StripAnsi(str string) string
- func Trunc(str string, limit int) string
- type CustomHook
- type LOG_LEVEL
- type Line
- type LogEntry
- type LogInterceptor
- type UpdateResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var Green = "\033[32m"
View Source
var Logger *log.Logger
View Source
var Red = "\033[31m"
View Source
var Reset = "\033[0m"
View Source
var Yellow = "\033[33m"
Functions ¶
func CheckUpdatesAndPrintInfo ¶
func CheckUpdatesAndPrintInfo(version string)
func InitLogger ¶
func InitLogger()
func LineCounterWithChannel ¶
func PickRandom ¶
func PickRandom[T any](slice []T) T
func ProcessIncomingMessages ¶
func RandStringRunes ¶
func SetLoggerDiscard ¶
func SetLoggerDiscard(discard bool)
func SetLoggerInterceptor ¶
func SetLoggerInterceptor(fn LogInterceptor)
func SetLoggerLevel ¶
func SetLoggerLevel(verbose bool)
Types ¶
type CustomHook ¶
type CustomHook struct {
// contains filtered or unexported fields
}
func (*CustomHook) Fire ¶
func (hook *CustomHook) Fire(entry *logrus.Entry) error
Fire is called whenever a log entry is made
func (*CustomHook) Levels ¶
func (hook *CustomHook) Levels() []logrus.Level
Levels returns the log levels that this hook will be fired for
type LOG_LEVEL ¶
type LOG_LEVEL int
const LOG_LEVEL_NORMAL LOG_LEVEL = 1
const LOG_LEVEL_SILENT LOG_LEVEL = 0
const LOG_LEVEL_VERBOSE LOG_LEVEL = 2
type LogEntry ¶
type LogEntry struct { Data map[string]interface{} Time time.Time // Level the log entry was logged at: Trace, Debug, Info, Warn, Error, Fatal or Panic // This field will be set on entry firing and the value will be equal to the one in Logger struct field. Level int // Calling method, with package name Caller *runtime.Frame // Message passed to Trace, Debug, Info, Warn, Error, Fatal or Panic Message string }
type LogInterceptor ¶
type LogInterceptor func(entry *LogEntry)
Click to show internal directories.
Click to hide internal directories.