Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Author ¶
type Author interface { // We cover some methods to add fields to the log message, here. We don't // want to cover every possible type, but some of the more common types are // provided. Log performance is not nearly as critical in an editor as it is // in server applications, so some amount of wasted type conversion and // extra allocation is reasonable, but we do want to make use of _some_ of // the advantages we get from using a zero-allocation logger under the // covers. Str(k, v string) Author Int(k string, v int) Author Float64(k string, v float64) Author Error(k string, v error) Author Dur(k string, d time.Duration) Author Stringer(k string, v fmt.Stringer) Author Interface(k string, v any) Author // Err(err) is sugar for Error("error", err) Err(error) Author // Msgf performs the write with a message included to provide some final // context after adding detail with the above methods. Msgf(string, ...any) }
Author is the type that actually constructs and writes a log message.
type Leveler ¶
type Leveler interface { Debug() Author Info() Author Warn() Author Error() Author // Err(err) is sugar for Error().Err(err) Err(error) Author }
Leveler represents a logging type that vidar can pass to plugins, to provide more consistent logging between vidar and third party tools.
Plugins should prefer to write UI messages (via the 'inform' operation) so that users can see the full detail; but sometimes, the detail is too excessive to show in a UI monolog. In those cases, the excessive detail may be logged to this logger and the UI message may inform the user that detail was added to vidar's log output.
Click to show internal directories.
Click to hide internal directories.