-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[slogger] Replace logger with slogger in dataflatten/exec #1612
[slogger] Replace logger with slogger in dataflatten/exec #1612
Conversation
d6242ff
to
3e5d93f
Compare
3e5d93f
to
11ab5c1
Compare
opts := []dataflatten.FlattenOpts{ | ||
dataflatten.WithLogger(logger), | ||
dataflatten.WithSlogger(multislogger.New().Logger), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is example code. It feels slightly weirf to pass multislogger
. Can we pass a simple slogger instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what we tend to copy-paste everywhere we need an unused slogger -- e.g. it's all over our unit tests. I'm not sure that this is wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤷
d8edf78
to
648454e
Compare
if fl.debugLogging { | ||
fl.logLevel = slog.LevelDebug | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect we could drop this, and simply log everything at at levelFlattenDebug
and let the caller apply the appropriate filter. But 🤷 maybe better to merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I liked this because it works the same way it used to 🤷♀️
Last step for removing logger from Kolide tables -- replaces logger with slogger in dataflatten/exec.