Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/charmbracelet/log
/ functions
Functions
181 in github.com/charmbracelet/log
⨍
Functions
181
◇
Types & classes
13
↓ 45 callers
Method
String
String returns the string representation of the level.
level.go:29
↓ 35 callers
Function
Default
Default returns the default logger. The default logger comes with timestamp enabled.
pkg.go:23
↓ 31 callers
Function
New
New returns a new logger with the default options.
pkg.go:42
↓ 27 callers
Method
Log
Log logs the given message with the given keyvals for the given level.
logger.go:55
↓ 25 callers
Method
Info
Info prints an info message.
logger.go:359
↓ 15 callers
Method
SetLevel
SetLevel sets the current level.
logger.go:242
↓ 13 callers
Method
With
With returns a new logger with the given keyvals added.
logger.go:331
↓ 12 callers
Function
SetReportCaller
SetReportCaller sets whether to report caller location for the default logger.
pkg.go:91
↓ 12 callers
Function
SetReportTimestamp
SetReportTimestamp sets whether to report timestamp for the default logger.
pkg.go:86
↓ 11 callers
Function
SetLevel
SetLevel sets the level for the default logger.
pkg.go:96
↓ 11 callers
Function
SetOutput
SetOutput sets the output for the default logger.
pkg.go:116
↓ 10 callers
Method
SetReportCaller
SetReportCaller sets whether the caller location should be reported.
logger.go:228
↓ 9 callers
Function
SetTimeFormat
SetTimeFormat sets the time format for the default logger.
pkg.go:106
↓ 8 callers
Method
Debug
Debug prints a debug message.
logger.go:354
↓ 8 callers
Method
SetFormatter
SetFormatter sets the formatter.
logger.go:300
↓ 7 callers
Method
Error
Error prints an error message.
logger.go:369
↓ 7 callers
Method
SetPrefix
SetPrefix sets the current prefix.
logger.go:256
↓ 7 callers
Function
SetTimeFunction
SetTimeFunction sets the time function for the default logger.
pkg.go:111
↓ 6 callers
Method
Errorf
Errorf prints an error message with formatting.
logger.go:400
↓ 6 callers
Method
SetColorProfile
SetColorProfile force sets the underlying color profile for the TextFormatter.
logger.go:293
↓ 6 callers
Method
SetReportTimestamp
SetReportTimestamp sets whether the timestamp should be reported.
logger.go:221
↓ 6 callers
Method
SetStyles
SetStyles sets the logger styles for the TextFormatter.
logger.go:321
↓ 5 callers
Function
DefaultStyles
DefaultStyles returns the default styles.
styles.go:43
↓ 5 callers
Method
Helper
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 callers
Function
NewWithOptions
NewWithOptions returns a new logger using the provided options.
pkg.go:47
↓ 5 callers
Method
Print
Print prints a message with no level.
logger.go:380
↓ 5 callers
Method
StandardLog
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 callers
Method
SetOutput
SetOutput sets the output destination.
logger.go:277
↓ 4 callers
Method
SetTimeFormat
SetTimeFormat sets the time format.
logger.go:263
↓ 4 callers
Method
SetTimeFunction
SetTimeFunction sets the time function.
logger.go:270
↓ 4 callers
Method
Warn
Warn prints a warning message.
logger.go:364
↓ 3 callers
Method
Fatalf
Fatalf prints a fatal message with formatting and exits.
logger.go:405
↓ 3 callers
Function
FromContext
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 callers
Method
GetLevel
GetLevel returns the current level.
logger.go:235
↓ 3 callers
Method
WithPrefix
WithPrefix returns a new logger with the given prefix.
logger.go:347
↓ 3 callers
Method
Write
(p []byte)
stdlog.go:13
↓ 3 callers
Method
end
()
json.go:111
↓ 3 callers
Method
handle
(level Level, ts time.Time, frames []runtime.Frame, msg any, keyvals ...any)
logger.go:83
↓ 3 callers
Method
objectValue
(value any)
json.go:135
↓ 3 callers
Method
start
()
json.go:106
↓ 2 callers
Function
Errorf
Errorf logs an error message with formatting.
pkg.go:230
↓ 2 callers
Method
Fatal
Fatal prints a fatal message and exits.
logger.go:374
↓ 2 callers
Method
GetPrefix
GetPrefix returns the current prefix.
logger.go:249
↓ 2 callers
Method
Logf
Logf logs a message with formatting.
logger.go:50
↓ 2 callers
Function
SetFormatter
SetFormatter sets the formatter for the default logger.
pkg.go:121
↓ 2 callers
Function
WithContext
WithContext wraps the given logger in context.
context.go:6
↓ 2 callers
Function
escapeStringForOutput
(str string, escapeQuotes bool)
text.go:70
↓ 2 callers
Method
frames
frames returns the runtime.Frames for the caller.
logger.go:165
↓ 2 callers
Method
helper
(skip int)
logger.go:155
↓ 2 callers
Method
jsonFormatterItem
(jw *jsonWriter, key, value any)
json.go:59
↓ 2 callers
Method
objectItem
(key string, value any)
json.go:115
↓ 2 callers
Method
objectKey
(key string)
json.go:120
↓ 2 callers
Method
writeEncoded
(v any)
json.go:144
↓ 1 callers
Function
Debugf
Debugf logs a debug message with formatting.
pkg.go:215
↓ 1 callers
Method
Enabled
Enabled reports whether the logger is enabled for the given level. Implements slog.Handler.
logger_121.go:26
↓ 1 callers
Function
Error
Error logs an error message.
pkg.go:194
↓ 1 callers
Function
Fatal
Fatal logs a fatal message and exit.
pkg.go:199
↓ 1 callers
Function
Fatalf
Fatalf logs a fatal message with formatting and exit.
pkg.go:235
↓ 1 callers
Function
GetLevel
GetLevel returns the level for the default logger.
pkg.go:101
↓ 1 callers
Function
GetPrefix
GetPrefix returns the prefix for the default logger.
pkg.go:152
↓ 1 callers
Method
Handle
Handle handles the Record. It will only be called if Enabled returns true. Implements slog.Handler.
logger_121.go:33
↓ 1 callers
Function
Info
Info logs an info message.
pkg.go:184
↓ 1 callers
Function
Infof
Infof logs an info message with formatting.
pkg.go:220
↓ 1 callers
Function
Log
Log logs a message with the given level.
pkg.go:174
↓ 1 callers
Method
LogValue
()
logger_121_test.go:192
↓ 1 callers
Function
Logf
Logf logs a message with formatting and level.
pkg.go:210
↓ 1 callers
Function
ParseLevel
ParseLevel converts level in string to Level type. Default level is InfoLevel.
level.go:50
↓ 1 callers
Function
Print
Print logs a message with no level.
pkg.go:205
↓ 1 callers
Function
Printf
Printf logs a message with formatting and no level.
pkg.go:241
↓ 1 callers
Method
Printf
Printf prints a message with no level and formatting.
logger.go:411
↓ 1 callers
Method
SetCallerFormatter
SetCallerFormatter sets the caller formatter.
logger.go:307
↓ 1 callers
Method
SetCallerOffset
SetCallerOffset sets the caller offset.
logger.go:314
↓ 1 callers
Function
SetDefault
SetDefault sets the default global logger.
pkg.go:37
↓ 1 callers
Function
SetPrefix
SetPrefix sets the prefix for the default logger.
pkg.go:136
↓ 1 callers
Method
String
()
examples/app/app.go:13
↓ 1 callers
Function
Warn
Warn logs a warning message.
pkg.go:189
↓ 1 callers
Function
Warnf
Warnf logs a warning message with formatting.
pkg.go:225
↓ 1 callers
Function
With
With returns a new logger with the given keyvals.
pkg.go:157
↓ 1 callers
Method
WithGroup
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 callers
Function
WithPrefix
WithPrefix returns a new logger with the given prefix.
pkg.go:162
↓ 1 callers
Method
jsonFormatter
(keyvals ...any)
json.go:10
↓ 1 callers
Method
jsonFormatterRoot
(jw *jsonWriter, key, value any)
json.go:32
↓ 1 callers
Method
location
(frames []runtime.Frame)
logger.go:176
↓ 1 callers
Method
logfmtFormatter
(keyvals ...any)
logfmt.go:11
↓ 1 callers
Function
needsEscaping
(str string)
text.go:50
↓ 1 callers
Function
needsQuoting
(s string)
text.go:128
↓ 1 callers
Function
ptr
(v T)
json_test.go:328
↓ 1 callers
Function
startOven
(degree int)
examples/app/app.go:21
↓ 1 callers
Function
startOven
(degree int)
examples/oven/oven.go:5
↓ 1 callers
Method
textFormatter
(keyvals ...any)
text.go:167
↓ 1 callers
Function
trimCallerPath
Cleanup a path by returning the last n segments of the path only.
logger.go:185
↓ 1 callers
Method
writeIndent
(w io.Writer, str string, indent string, newline bool, key string)
text.go:18
↓ 1 callers
Method
writeSlogValue
(jw *jsonWriter, v slogValue)
json.go:82
↓ 1 callers
Function
writeSpace
(w io.Writer, first bool)
text.go:161
Function
Debug
Debug logs a debug message.
pkg.go:179
Method
Debugf
Debugf prints a debug message with formatting.
logger.go:385
Method
Enabled
Enabled reports whether the logger is enabled for the given level. Implements slog.Handler.
logger_no121.go:27
Method
Handle
Handle handles the Record. It will only be called if Enabled returns true. Implements slog.Handler.
logger_no121.go:34
Function
Helper
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
Method
Infof
Infof prints an info message with formatting.
logger.go:390
next →
1–100 of 181, ranked by callers