mirror of
https://github.com/rwinkhart/go-winio.git
synced 2026-10-27 05:29:58 -04:00
Return error from WriteEvent in Logrus hook
This commit is contained in:
1 parent
d23783336b
commit
82fc62aed2
1 file changed
+1
-3
@@ -64,12 +64,10 @@ func (h *Hook) Fire(e *logrus.Entry) error {
|
|||||||
// We could try to map Logrus levels to ETW levels, but we would lose some
|
// We could try to map Logrus levels to ETW levels, but we would lose some
|
||||||
// fidelity as there are fewer ETW levels. So instead we use the level
|
// fidelity as there are fewer ETW levels. So instead we use the level
|
||||||
// directly.
|
// directly.
|
||||||
h.provider.WriteEvent(
|
return h.provider.WriteEvent(
|
||||||
"LogrusEntry",
|
"LogrusEntry",
|
||||||
etw.WithEventOpts(etw.WithLevel(level)),
|
etw.WithEventOpts(etw.WithLevel(level)),
|
||||||
fields)
|
fields)
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close cleans up the hook and closes the ETW provider.
|
// Close cleans up the hook and closes the ETW provider.
|
||||||
|
|||||||
Reference in new issue
Block a user