Improve ETW callback support and track provider enable state

This commit is contained in:
Kevin Parsons committed 2018-12-19 01:42:44 -08:00
1 parent 35e42dab22
commit dcfdf4a9f6
2 files changed
+127 -11

No files matched your search

+4
View File
@@ -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