()
| 24 | ) |
| 25 | |
| 26 | func init() { |
| 27 | platform.Register( |
| 28 | platform.NewPlugin("audit", "0.1.0"). |
| 29 | Observer(platform.After, "log", platform.All(), |
| 30 | func(ctx context.Context, inv platform.Invocation) { |
| 31 | path := inv.Cmd().Path() |
| 32 | if err := inv.Err(); err != nil { |
| 33 | fmt.Fprintf(os.Stderr, "[audit] %s FAILED: %v\n", path, err) |
| 34 | } else { |
| 35 | log.Printf("[audit] %s ok", path) |
| 36 | } |
| 37 | }). |
| 38 | FailOpen(). |
| 39 | MustBuild()) |
| 40 | } |
| 41 | |
| 42 | func main() { |
| 43 | os.Exit(cmd.Execute()) |