Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/sirupsen/logrus
/ types & classes
Types & classes
65 in github.com/sirupsen/logrus
⨍
Functions
525
◇
Types & classes
65
↓ 3 callers
TypeAlias
Level
Level type nolint:recvcheck // the methods of "Entry" use pointer receiver and non-pointer receiver.
logrus.go:15
↓ 2 callers
TypeAlias
Level
Level adapts a [logrus.Level] to a [slog.Leveler] using the default Logrus-to-slog level mapping: - [logrus.TraceLevel] -> [slog.LevelDebug] - 4 - [l
hooks/slog/level.go:44
↓ 2 callers
TypeAlias
SlogLevel
SlogLevel adapts a [slog.Level] to a [Leveler] using the default slog-to-Logrus level mapping: - [slog.LevelDebug] - 4 -> [logrus.TraceLevel] - [slog
hooks/slog/level.go:67
↓ 1 callers
Interface
Ext1FieldLogger
Ext1FieldLogger is FieldLogger extended with Trace-level methods. New code should prefer the smallest applicable interface, such as [FieldLogger] or
logrus.go:224
↓ 1 callers
TypeAlias
benchStringer
formatter_bench_test.go:12
↓ 1 callers
TypeAlias
channelWriter
Implements io.Writer using channels for synchronization, so we can wait on the Entry.Writer goroutine to write in a non-racey way. This does assume th
logrus_test.go:723
↓ 1 callers
FuncType
funcError
func()
entry_test.go:35
↓ 1 callers
TypeAlias
panicError
text_formatter_test.go:695
↓ 1 callers
TypeAlias
panicStringer
text_formatter_test.go:699
Interface
BufferPool
buffer_pool.go:16
Interface
DebugLogger
DebugLogger provides convenience functions to log messages at level [DebugLevel].
logrus.go:186
Struct
DefaultFieldHook
example_default_field_value_test.go:9
Struct
Entry
Entry represents a single log event. It may be either an intermediate entry (created via WithField(s), WithContext, etc.) or a final entry that is emi
entry.go:53
Struct
ErrorHook
hook_test.go:157
Interface
ErrorLogger
ErrorLogger provides convenience functions to log messages at level [ErrorLevel].
logrus.go:207
Interface
FieldLogger
FieldLogger extends the [StdLogger] interface, generalizing the [Entry] and [Logger] types.
logrus.go:166
TypeAlias
FieldMap
FieldMap allows customization of the key names for default fields.
json_formatter.go:14
TypeAlias
Fields
Fields type, used to pass to [WithFields].
logrus.go:10
Interface
Formatter
Formatter is implemented by types that format log entries. It receives an [*Entry], which contains: - entry.Message: the message passed to logging me
formatter.go:39
Struct
GlobalHook
example_global_hook_test.go:11
Struct
Handler
Handler is a [slog.Handler] that writes records to a [logrus.Logger]. It is intended for bridging libraries or application code that log via slog int
hooks/slog/handler.go:37
Struct
HandlerOptions
HandlerOptions are options for a [Handler]. A zero HandlerOptions consists entirely of default values.
hooks/slog/handler.go:16
Interface
Hook
Hook describes hooks to be fired when logging on the logging levels returned from [Hook.Levels] on your implementation of the interface. Note that thi
hooks.go:8
Struct
Hook
Hook is a hook that writes logs of specified LogLevels to specified Writer
hooks/writer/writer.go:10
Struct
Hook
Hook is a hook designed for dealing with logs in test scenarios.
hooks/test/test.go:13
Struct
Hook
Hook sends Logrus entries to slog. It is intended for bridging libraries or application code that log via Logrus into an existing slog logger, for ex
hooks/slog/slog.go:56
Struct
HookCallFunc
hook_test.go:237
Struct
HookOptions
HookOptions are options for a [Hook]. A zero HookOptions consists entirely of default values.
hooks/slog/slog.go:42
Interface
InfoLogger
InfoLogger provides convenience functions to log messages at level [InfoLevel].
logrus.go:193
Struct
JSONFormatter
JSONFormatter formats logs into parsable JSON. Fields from [Entry.Data] are included in the JSON object together with the standard fields derived fro
json_formatter.go:31
TypeAlias
LevelHooks
LevelHooks is an internal type for storing the hooks on a logger instance.
hooks.go:14
Interface
Leveler
A Leveler provides a [logrus.Level] value. It is the Logrus counterpart of [slog.Leveler]. As [SlogLevel] itself implements Leveler, clients typical
hooks/slog/level.go:28
FuncType
LogFunction
LogFunction For big messages, it can be more efficient to pass a function and only call it if the log level is actually enables rather than generating
logger.go:15
Struct
Logger
logger.go:17
Struct
LoggerLevel
LoggerLevel exposes a Logrus logger's configured level as a slog.Leveler. This lets slog handlers follow changes to the Logrus logger's level without
hooks/slog/level_example_test.go:15
Struct
ModifyHook
hook_test.go:70
Struct
RecordingFormatter
RecordingFormatter is a test helper that implements Formatter and records information about the last formatted Entry. On every call to Format, it inc
hook_test.go:25
Struct
SingleLevelModifyHook
hook_test.go:118
Interface
StdLogger
StdLogger is what your logrus-enabled library should take, that way it'll accept a stdlib logger ([log.Logger]) and a logrus logger. There's no standa
logrus.go:150
Struct
SyslogHook
SyslogHook to send logs via syslog.
hooks/syslog/syslog.go:14
Struct
TestHook
hook_test.go:36
Struct
TextFormatter
TextFormatter formats logs into text. Output is logfmt-like: key=value pairs separated by spaces. Fields from [Entry.Data] are included together with
text_formatter.go:32
Interface
TraceLogger
TraceLogger provides convenience functions to log messages at level [TraceLevel].
logrus.go:214
Interface
WarnLogger
WarnLogger provides convenience functions to log messages at level [WarnLevel].
logrus.go:200
Struct
X
level_test.go:13
Struct
bufferWithMu
writer_test.go:45
TypeAlias
contextKeyType
entry_test.go:39
Struct
ctxKey
hooks/slog/slog_test.go:272
Struct
ctxKey
hooks/slog/handler_test.go:296
Struct
defaultPool
buffer_pool.go:21
Struct
errorHandler
hooks/slog/slog_test.go:97
TypeAlias
fieldKey
json_formatter.go:11
Struct
logrusLoggerContextKey
logrusLoggerContextKey is the context key used to track Logrus loggers a record has already traversed while being forwarded through slog adapters.
hooks/slog/slog.go:18
Struct
lvlPrefix
level.go:17
Struct
mutexWrap
logger.go:63
Struct
nilError
text_formatter_test.go:703
Struct
nilStringer
text_formatter_test.go:711
Struct
nilValueError
text_formatter_test.go:707
Struct
nilValueStringer
text_formatter_test.go:715
Struct
noopHook
entry_test.go:21
Struct
nopBufferPool
entry_test.go:26
Struct
nopFormatter
entry_test.go:31
Struct
panickyHook
entry_test.go:320
Struct
reentrantValue
reentrantValue is a type whose MarshalJSON method triggers another log call, which would deadlock if the logger mutex is held during formatting.
entry_test.go:532
Struct
testBufferPool
logger_test.go:37