MCPcopy Create free account

hub / github.com/charmbracelet/log / functions

Functions181 in github.com/charmbracelet/log

↓ 45 callersMethodString
String returns the string representation of the level.
level.go:29
↓ 35 callersFunctionDefault
Default returns the default logger. The default logger comes with timestamp enabled.
pkg.go:23
↓ 31 callersFunctionNew
New returns a new logger with the default options.
pkg.go:42
↓ 27 callersMethodLog
Log logs the given message with the given keyvals for the given level.
logger.go:55
↓ 25 callersMethodInfo
Info prints an info message.
logger.go:359
↓ 15 callersMethodSetLevel
SetLevel sets the current level.
logger.go:242
↓ 13 callersMethodWith
With returns a new logger with the given keyvals added.
logger.go:331
↓ 12 callersFunctionSetReportCaller
SetReportCaller sets whether to report caller location for the default logger.
pkg.go:91
↓ 12 callersFunctionSetReportTimestamp
SetReportTimestamp sets whether to report timestamp for the default logger.
pkg.go:86
↓ 11 callersFunctionSetLevel
SetLevel sets the level for the default logger.
pkg.go:96
↓ 11 callersFunctionSetOutput
SetOutput sets the output for the default logger.
pkg.go:116
↓ 10 callersMethodSetReportCaller
SetReportCaller sets whether the caller location should be reported.
logger.go:228
↓ 9 callersFunctionSetTimeFormat
SetTimeFormat sets the time format for the default logger.
pkg.go:106
↓ 8 callersMethodDebug
Debug prints a debug message.
logger.go:354
↓ 8 callersMethodSetFormatter
SetFormatter sets the formatter.
logger.go:300
↓ 7 callersMethodError
Error prints an error message.
logger.go:369
↓ 7 callersMethodSetPrefix
SetPrefix sets the current prefix.
logger.go:256
↓ 7 callersFunctionSetTimeFunction
SetTimeFunction sets the time function for the default logger.
pkg.go:111
↓ 6 callersMethodErrorf
Errorf prints an error message with formatting.
logger.go:400
↓ 6 callersMethodSetColorProfile
SetColorProfile force sets the underlying color profile for the TextFormatter.
logger.go:293
↓ 6 callersMethodSetReportTimestamp
SetReportTimestamp sets whether the timestamp should be reported.
logger.go:221
↓ 6 callersMethodSetStyles
SetStyles sets the logger styles for the TextFormatter.
logger.go:321
↓ 5 callersFunctionDefaultStyles
DefaultStyles returns the default styles.
styles.go:43
↓ 5 callersMethodHelper
Helper marks the calling function as a helper and skips it for source location information. It's the equivalent of testing.TB.Helper().
logger.go:151
↓ 5 callersFunctionNewWithOptions
NewWithOptions returns a new logger using the provided options.
pkg.go:47
↓ 5 callersMethodPrint
Print prints a message with no level.
logger.go:380
↓ 5 callersMethodStandardLog
StandardLog returns a standard logger from Logger. The returned logger can infer log levels from message prefix. Expected prefixes are DEBUG, INFO, WA
stdlog.go:55
↓ 4 callersMethodSetOutput
SetOutput sets the output destination.
logger.go:277
↓ 4 callersMethodSetTimeFormat
SetTimeFormat sets the time format.
logger.go:263
↓ 4 callersMethodSetTimeFunction
SetTimeFunction sets the time function.
logger.go:270
↓ 4 callersMethodWarn
Warn prints a warning message.
logger.go:364
↓ 3 callersMethodFatalf
Fatalf prints a fatal message with formatting and exits.
logger.go:405
↓ 3 callersFunctionFromContext
FromContext returns the logger from the given context. This will return the default package logger if no logger found in context.
context.go:13
↓ 3 callersMethodGetLevel
GetLevel returns the current level.
logger.go:235
↓ 3 callersMethodWithPrefix
WithPrefix returns a new logger with the given prefix.
logger.go:347
↓ 3 callersMethodWrite
(p []byte)
stdlog.go:13
↓ 3 callersMethodend
()
json.go:111
↓ 3 callersMethodhandle
(level Level, ts time.Time, frames []runtime.Frame, msg any, keyvals ...any)
logger.go:83
↓ 3 callersMethodobjectValue
(value any)
json.go:135
↓ 3 callersMethodstart
()
json.go:106
↓ 2 callersFunctionErrorf
Errorf logs an error message with formatting.
pkg.go:230
↓ 2 callersMethodFatal
Fatal prints a fatal message and exits.
logger.go:374
↓ 2 callersMethodGetPrefix
GetPrefix returns the current prefix.
logger.go:249
↓ 2 callersMethodLogf
Logf logs a message with formatting.
logger.go:50
↓ 2 callersFunctionSetFormatter
SetFormatter sets the formatter for the default logger.
pkg.go:121
↓ 2 callersFunctionWithContext
WithContext wraps the given logger in context.
context.go:6
↓ 2 callersFunctionescapeStringForOutput
(str string, escapeQuotes bool)
text.go:70
↓ 2 callersMethodframes
frames returns the runtime.Frames for the caller.
logger.go:165
↓ 2 callersMethodhelper
(skip int)
logger.go:155
↓ 2 callersMethodjsonFormatterItem
(jw *jsonWriter, key, value any)
json.go:59
↓ 2 callersMethodobjectItem
(key string, value any)
json.go:115
↓ 2 callersMethodobjectKey
(key string)
json.go:120
↓ 2 callersMethodwriteEncoded
(v any)
json.go:144
↓ 1 callersFunctionDebugf
Debugf logs a debug message with formatting.
pkg.go:215
↓ 1 callersMethodEnabled
Enabled reports whether the logger is enabled for the given level. Implements slog.Handler.
logger_121.go:26
↓ 1 callersFunctionError
Error logs an error message.
pkg.go:194
↓ 1 callersFunctionFatal
Fatal logs a fatal message and exit.
pkg.go:199
↓ 1 callersFunctionFatalf
Fatalf logs a fatal message with formatting and exit.
pkg.go:235
↓ 1 callersFunctionGetLevel
GetLevel returns the level for the default logger.
pkg.go:101
↓ 1 callersFunctionGetPrefix
GetPrefix returns the prefix for the default logger.
pkg.go:152
↓ 1 callersMethodHandle
Handle handles the Record. It will only be called if Enabled returns true. Implements slog.Handler.
logger_121.go:33
↓ 1 callersFunctionInfo
Info logs an info message.
pkg.go:184
↓ 1 callersFunctionInfof
Infof logs an info message with formatting.
pkg.go:220
↓ 1 callersFunctionLog
Log logs a message with the given level.
pkg.go:174
↓ 1 callersMethodLogValue
()
logger_121_test.go:192
↓ 1 callersFunctionLogf
Logf logs a message with formatting and level.
pkg.go:210
↓ 1 callersFunctionParseLevel
ParseLevel converts level in string to Level type. Default level is InfoLevel.
level.go:50
↓ 1 callersFunctionPrint
Print logs a message with no level.
pkg.go:205
↓ 1 callersFunctionPrintf
Printf logs a message with formatting and no level.
pkg.go:241
↓ 1 callersMethodPrintf
Printf prints a message with no level and formatting.
logger.go:411
↓ 1 callersMethodSetCallerFormatter
SetCallerFormatter sets the caller formatter.
logger.go:307
↓ 1 callersMethodSetCallerOffset
SetCallerOffset sets the caller offset.
logger.go:314
↓ 1 callersFunctionSetDefault
SetDefault sets the default global logger.
pkg.go:37
↓ 1 callersFunctionSetPrefix
SetPrefix sets the prefix for the default logger.
pkg.go:136
↓ 1 callersMethodString
()
examples/app/app.go:13
↓ 1 callersFunctionWarn
Warn logs a warning message.
pkg.go:189
↓ 1 callersFunctionWarnf
Warnf logs a warning message with formatting.
pkg.go:225
↓ 1 callersFunctionWith
With returns a new logger with the given keyvals.
pkg.go:157
↓ 1 callersMethodWithGroup
WithGroup returns a new Handler with the given group name prepended to the current group name or prefix. Implements slog.Handler.
logger_121.go:65
↓ 1 callersFunctionWithPrefix
WithPrefix returns a new logger with the given prefix.
pkg.go:162
↓ 1 callersMethodjsonFormatter
(keyvals ...any)
json.go:10
↓ 1 callersMethodjsonFormatterRoot
(jw *jsonWriter, key, value any)
json.go:32
↓ 1 callersMethodlocation
(frames []runtime.Frame)
logger.go:176
↓ 1 callersMethodlogfmtFormatter
(keyvals ...any)
logfmt.go:11
↓ 1 callersFunctionneedsEscaping
(str string)
text.go:50
↓ 1 callersFunctionneedsQuoting
(s string)
text.go:128
↓ 1 callersFunctionptr
(v T)
json_test.go:328
↓ 1 callersFunctionstartOven
(degree int)
examples/app/app.go:21
↓ 1 callersFunctionstartOven
(degree int)
examples/oven/oven.go:5
↓ 1 callersMethodtextFormatter
(keyvals ...any)
text.go:167
↓ 1 callersFunctiontrimCallerPath
Cleanup a path by returning the last n segments of the path only.
logger.go:185
↓ 1 callersMethodwriteIndent
(w io.Writer, str string, indent string, newline bool, key string)
text.go:18
↓ 1 callersMethodwriteSlogValue
(jw *jsonWriter, v slogValue)
json.go:82
↓ 1 callersFunctionwriteSpace
(w io.Writer, first bool)
text.go:161
FunctionDebug
Debug logs a debug message.
pkg.go:179
MethodDebugf
Debugf prints a debug message with formatting.
logger.go:385
MethodEnabled
Enabled reports whether the logger is enabled for the given level. Implements slog.Handler.
logger_no121.go:27
MethodHandle
Handle handles the Record. It will only be called if Enabled returns true. Implements slog.Handler.
logger_no121.go:34
FunctionHelper
Helper marks the calling function as a helper and skips it for source location information. It's the equivalent of testing.TB.Helper().
pkg.go:169
MethodInfof
Infof prints an info message with formatting.
logger.go:390
next →1–100 of 181, ranked by callers