Skip to content

Commit

Permalink
PR: export and comment
Browse files Browse the repository at this point in the history
Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
  • Loading branch information
helsaawy committed Apr 27, 2022
1 parent c9495cf commit 99a8ff7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/etwlogrus/hook.go
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/Microsoft/go-winio/pkg/etw"
)

const DefaultEventName = "LogrusEntry"
const defaultEventName = "LogrusEntry"

var ErrNoProvider = errors.New("no ETW registered provider")

Expand Down Expand Up @@ -96,13 +96,15 @@ func (h *Hook) Fire(e *logrus.Entry) error {
return nil
}

name := DefaultEventName
name := defaultEventName
if h.getName != nil {
if n := h.getName(e); n != "" {
name = n
}
}

// extra room for two more options in addition to log level to avoid repeated reallocations
// if the user also provides options
opts := make([]etw.EventOpt, 0, 3)
opts = append(opts, etw.WithLevel(level))
if h.getEventsOpts != nil {
Expand Down

0 comments on commit 99a8ff7

Please sign in to comment.