Skip to content
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

Merged

Conversation

RebeccaMahany
Copy link
Contributor

@RebeccaMahany RebeccaMahany commented Feb 16, 2024

Last step for removing logger from Kolide tables -- replaces logger with slogger in dataflatten/exec.

directionless
directionless previously approved these changes Feb 17, 2024
cmd/launcher/interactive.go Outdated Show resolved Hide resolved
directionless
directionless previously approved these changes Feb 21, 2024
opts := []dataflatten.FlattenOpts{
dataflatten.WithLogger(logger),
dataflatten.WithSlogger(multislogger.New().Logger),
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷

ee/dataflatten/flatten.go Outdated Show resolved Hide resolved
Comment on lines +150 to 152
if fl.debugLogging {
fl.logLevel = slog.LevelDebug
}
Copy link
Contributor

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

Copy link
Contributor Author

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 🤷‍♀️

@RebeccaMahany RebeccaMahany added this pull request to the merge queue Feb 22, 2024
Merged via the queue into kolide:main with commit c44976d Feb 22, 2024
30 checks passed
@RebeccaMahany RebeccaMahany deleted the becca/slogger-exec-dataflatten branch February 22, 2024 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants