Improve ETW callback support and track provider enable state

This commit is contained in:
Kevin Parsons
2018-12-19 01:42:44 -08:00
parent 35e42dab22
commit dcfdf4a9f6
2 changed files with 127 additions and 11 deletions
+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