-
Notifications
You must be signed in to change notification settings - Fork 594
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
Output of entity changes in KIC's logs instead of Println
in database-reconciler repo
#5289
Comments
Not quite.
We need to add a new log loop that does handle that with some sort of diff output, or add a debug endpoint for it. My original intent was to do the latter, since even with our own logger and without the colors, the diffs don't lend themselves well to logging because they require multiple lines to be legible, and break the usual log contract as such. Having a endpoint that just prints the latest diff elsewhere displays that more cleanly. We could opt to still log basic "entity changed successfully" info alongside that. Edit: nevermind, I forgot that return was for the legacy format. We do log changes through the new channel system in kubernetes-ingress-controller/internal/dataplane/sendconfig/dbmode.go Lines 125 to 134 in 5cefa9a
Full diff endpoint pending #6101 |
@randmonkey do you think there's much to do to review and get this PR merged in? Seems like @rainest had this implemented already |
OK, let me review it again if it has been already done. |
Is there an existing issue for this?
Problem Statement
Currently we enable output of
go-database-reconciler
in setup when log level is set totrace
ordebug
:kubernetes-ingress-controller/internal/manager/setup.go
Lines 48 to 50 in 64a0a61
This uses
cprint
in https://github.com/Kong/go-database-reconciler to output the entity changes, which calls https://github.com/fatih/color for printing message on the terminal in ANSI colors. This output format is suitable for terminal but not for log files. It brings inconsistency in logs, and may print special characters for colors.Proposed Solution
diff.Solve
Additional information
We should also consider updating the code in https://github.com/Kong/go-database-reconciler after separated it from decK. This repo is not mainly used as a CLI as decK, so the direct output to terminal may need to be cleaned.
Acceptance Criteria
The text was updated successfully, but these errors were encountered: