feat(aa-log): resolve all main apparmor vars in log.
This also deprecate the anonymize option
This commit is contained in:
parent
5ee31716ae
commit
e0f79b9c9a
4 changed files with 57 additions and 123 deletions
|
|
@ -28,19 +28,17 @@ Options:
|
|||
-h, --help Show this help message and exit.
|
||||
-f, --file FILE Set a logfile or a suffix to the default log file.
|
||||
-s, --systemd Parse systemd logs from journalctl.
|
||||
-a, --anonymize Anonymize the logs.
|
||||
|
||||
`
|
||||
|
||||
// Command line options
|
||||
var (
|
||||
help bool
|
||||
anonymize bool
|
||||
path string
|
||||
systemd bool
|
||||
help bool
|
||||
path string
|
||||
systemd bool
|
||||
)
|
||||
|
||||
func aaLog(logger string, path string, profile string, anonymize bool) error {
|
||||
func aaLog(logger string, path string, profile string) error {
|
||||
var err error
|
||||
var file io.Reader
|
||||
|
||||
|
|
@ -56,9 +54,6 @@ func aaLog(logger string, path string, profile string, anonymize bool) error {
|
|||
return err
|
||||
}
|
||||
aaLogs := logs.NewApparmorLogs(file, profile)
|
||||
if anonymize {
|
||||
aaLogs.Anonymize()
|
||||
}
|
||||
fmt.Print(aaLogs.String())
|
||||
return nil
|
||||
}
|
||||
|
|
@ -70,8 +65,6 @@ func init() {
|
|||
flag.StringVar(&path, "file", "", "Set a logfile or a suffix to the default log file.")
|
||||
flag.BoolVar(&systemd, "s", false, "Parse systemd logs from journalctl.")
|
||||
flag.BoolVar(&systemd, "systemd", false, "Parse systemd logs from journalctl.")
|
||||
flag.BoolVar(&anonymize, "a", false, "Anonymize the logs.")
|
||||
flag.BoolVar(&anonymize, "anonymize", false, "Anonymize the logs.")
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
|
@ -93,7 +86,7 @@ func main() {
|
|||
}
|
||||
|
||||
logfile := logs.GetLogFile(path)
|
||||
err := aaLog(logger, logfile, profile, anonymize)
|
||||
err := aaLog(logger, logfile, profile)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue