From a4f41e10542af739183dfbd31b70c5b0ae851f7f Mon Sep 17 00:00:00 2001 From: Mark Phelps <209477+markphelps@users.noreply.github.com> Date: Sun, 26 May 2024 16:50:42 -0400 Subject: [PATCH] chore: simplify audit log default stdout logic Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com> --- internal/server/audit/log/log.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/server/audit/log/log.go b/internal/server/audit/log/log.go index d78412c9fb..45fce206eb 100644 --- a/internal/server/audit/log/log.go +++ b/internal/server/audit/log/log.go @@ -59,11 +59,9 @@ func NewSink(logger *zap.Logger, path string) (audit.Sink, error) { // newSink is the constructor for a Sink visible for testing. func newSink(logger *zap.Logger, path string, fs filesystem) (audit.Sink, error) { - var f file + var f file = os.Stdout - if path == "" { - f = os.Stdout - } else { + if path != "" { // check if path exists, if not create it dir := filepath.Dir(path) if _, err := fs.Stat(dir); err != nil {