Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoProvider = errors.New("no ETW registered provider")
ErrNoProvider is returned when a hook is created without a provider being configured.
Functions ¶
This section is empty.
Types ¶
type Hook ¶
type Hook struct {
// contains filtered or unexported fields
}
Hook is a Logrus hook which logs received events to ETW.
func NewHook ¶
NewHook registers a new ETW provider and returns a hook to log from it. The provider will be closed when the hook is closed.
func NewHookFromOpts ¶ added in v0.6.0
NewHookFromOpts creates a new hook with the provided options. An error is returned if the hook does not have a valid provider.
func NewHookFromProvider ¶ added in v0.4.13
NewHookFromProvider creates a new hook based on an existing ETW provider. The provider will not be closed when the hook is closed.
func (*Hook) Close ¶
Close cleans up the hook and closes the ETW provider. If the provder was registered by etwlogrus, it will be closed as part of `Close`. If the provider was passed in, it will not be closed.
type HookOpt ¶ added in v0.6.0
HookOpt is an option to change the behavior of the Logrus ETW hook.
func WithEventOpts ¶ added in v0.6.0
WithEventOpts allows additional ETW event properties (keywords, tags, etc.) to be specified.
func WithExistingETWProvider ¶ added in v0.6.0
WithExistingETWProvider configures the hook to use an existing ETW provider. The provider will not be closed when the hook is closed.
func WithGetName ¶ added in v0.6.0
WithGetName sets the ETW EventName of an event to the value returned by f If the name is empty, the default event name will be used.
func WithNewETWProvider ¶ added in v0.6.0
WithNewETWProvider registers a new ETW provider and sets the hook to log using it. The provider will be closed when the hook is closed.