Windows Event Log, error output

Adding more Event Log support, and modifying the loggers so they return
errors in their operational functions.
This commit is contained in:
2022-01-16 02:05:42 -05:00
parent 3d0d420454
commit 39e0a1fd43
18 changed files with 612 additions and 220 deletions

View File

@@ -3,7 +3,6 @@ package logging
import (
`os`
`path/filepath`
`regexp`
`r00t2.io/goutils/bitmask`
)
@@ -28,8 +27,21 @@ var (
}
)
// ptrnSourceExists is a regex pattern to check for a registry entry (Event Log entry) already existing.
var ptrnSourceExists *regexp.Regexp = regexp.MustCompile(`registry\skey\salready\sexists$`)
/*
ptrnSourceExists is a regex pattern to check for a registry entry (Event Log entry) already existing.
Deprecated: this is handled differently now.
*/
// var ptrnSourceExists *regexp.Regexp = regexp.MustCompile(`registry\skey\salready\sexists$`)
const (
EIDMin uint32 = 1
EIDMax uint32 = 1000
)
const (
eventLogRegistryKey string = "SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application"
)
// Default WinEventID, (can be) used in GetLogger and MultiLogger.AddWinLogger.
var DefaultEventID *WinEventID = &WinEventID{