mirror of
https://github.com/rwinkhart/go-winio.git
synced 2026-10-27 21:49:56 -04:00
Improve ETW callback support and track provider enable state
This commit is contained in:
1 parent
35e42dab22
commit
dcfdf4a9f6
2 files changed
+127
-11
No files matched your search
@@ -44,6 +44,10 @@ func (h *Hook) Levels() []logrus.Level {
|
||||
|
||||
// Fire receives each Logrus entry as it is logged, and logs it to ETW.
|
||||
func (h *Hook) Fire(e *logrus.Entry) error {
|
||||
if !h.provider.IsEnabledForLevel(etw.Level(e.Level)) {
|
||||
return
|
||||
}
|
||||
|
||||
descriptor := etw.NewEventDescriptor()
|
||||
|
||||
// We could try to map Logrus levels to ETW levels, but we would lose some
|
||||
|
||||
Reference in new issue
Block a user