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

fix: Skip flagd banner when non-console logger in use #1516

Merged
merged 2 commits into from
Jan 17, 2025

Conversation

austindrenski
Copy link
Member

This PR

  • Moves the (very nice) flagd console banner behind a flag check to avoid sending the (again, very nice) console banner to JSON log files, sinks, k8s trailers, etc.

How to test

$ go run main.go start -f file:../config/samples/example_flags.flagd.json

                 ______   __       ________   _______    ______
                /_____/\ /_/\     /_______/\ /______/\  /_____/\
                \::::_\/_\:\ \    \::: _  \ \\::::__\/__\:::_ \ \
                 \:\/___/\\:\ \    \::(_)  \ \\:\ /____/\\:\ \ \ \
                  \:::._\/ \:\ \____\:: __  \ \\:\\_  _\/ \:\ \ \ \
                   \:\ \    \:\/___/\\:.\ \  \ \\:\_\ \ \  \:\/.:| |
                    \_\/     \_____\/ \__\/\__\/ \_____\/   \____/_/

2025-01-15T19:41:51.347-0500    info    cmd/start.go:124        flagd version: dev (HEAD), built at: unknown    {"component": "start"}
2025-01-15T19:41:51.347-0500    info    flag-sync/sync_service.go:87    starting flag sync service on port 8015 {"component": "FlagSyncService"}
2025-01-15T19:41:51.347-0500    info    file/filepath_sync.go:62        Starting filepath sync notifier {"component": "sync", "sync": "fileinfo"}
2025-01-15T19:41:51.347-0500    info    ofrep/ofrep_service.go:58       ofrep service listening at 8016 {"component": "OFREPService"}
2025-01-15T19:41:51.347-0500    info    flag-evaluation/connect_service.go:249  metrics and probes listening at 8014    {"component": "service"}
2025-01-15T19:41:51.347-0500    info    file/filepath_sync.go:101       watching filepath: ../config/samples/example_flags.flagd.json   {"component": "sync", "sync": "fileinfo"}
2025-01-15T19:41:51.347-0500    info    flag-evaluation/connect_service.go:229  Flag IResolver listening at [::]:8013   {"component": "service"}
$ go run main.go start -f file:../config/samples/example_flags.flagd.json --log-format console

                 ______   __       ________   _______    ______
                /_____/\ /_/\     /_______/\ /______/\  /_____/\
                \::::_\/_\:\ \    \::: _  \ \\::::__\/__\:::_ \ \
                 \:\/___/\\:\ \    \::(_)  \ \\:\ /____/\\:\ \ \ \
                  \:::._\/ \:\ \____\:: __  \ \\:\\_  _\/ \:\ \ \ \
                   \:\ \    \:\/___/\\:.\ \  \ \\:\_\ \ \  \:\/.:| |
                    \_\/     \_____\/ \__\/\__\/ \_____\/   \____/_/

2025-01-15T19:41:39.375-0500    info    cmd/start.go:124        flagd version: dev (HEAD), built at: unknown    {"component": "start"}
2025-01-15T19:41:39.376-0500    info    flag-sync/sync_service.go:87    starting flag sync service on port 8015 {"component": "FlagSyncService"}
2025-01-15T19:41:39.378-0500    info    file/filepath_sync.go:62        Starting filepath sync notifier {"component": "sync", "sync": "fileinfo"}
2025-01-15T19:41:39.380-0500    info    ofrep/ofrep_service.go:58       ofrep service listening at 8016 {"component": "OFREPService"}
2025-01-15T19:41:39.380-0500    info    flag-evaluation/connect_service.go:249  metrics and probes listening at 8014    {"component": "service"}
2025-01-15T19:41:39.380-0500    info    flag-evaluation/connect_service.go:229  Flag IResolver listening at [::]:8013   {"component": "service"}
2025-01-15T19:41:39.381-0500    info    file/filepath_sync.go:101       watching filepath: ../config/samples/example_flags.flagd.json   {"component": "sync", "sync": "fileinfo"}
$ go run main.go start -f file:../config/samples/example_flags.flagd.json --log-format json
{"level":"info","ts":"2025-01-15T19:41:19.857-0500","caller":"cmd/start.go:124","msg":"flagd version: dev (HEAD), built at: unknown","component":"start"}
{"level":"info","ts":"2025-01-15T19:41:19.857-0500","caller":"flag-sync/sync_service.go:87","msg":"starting flag sync service on port 8015","component":"FlagSyncService"}
{"level":"info","ts":"2025-01-15T19:41:19.861-0500","caller":"file/filepath_sync.go:62","msg":"Starting filepath sync notifier","component":"sync","sync":"fileinfo"}
{"level":"info","ts":"2025-01-15T19:41:19.863-0500","caller":"ofrep/ofrep_service.go:58","msg":"ofrep service listening at 8016","component":"OFREPService"}
{"level":"info","ts":"2025-01-15T19:41:19.863-0500","caller":"flag-evaluation/connect_service.go:249","msg":"metrics and probes listening at 8014","component":"service"}
{"level":"info","ts":"2025-01-15T19:41:19.864-0500","caller":"file/filepath_sync.go:101","msg":"watching filepath: ../config/samples/example_flags.flagd.json","component":"sync","sync":"fileinfo"}
{"level":"info","ts":"2025-01-15T19:41:19.864-0500","caller":"flag-evaluation/connect_service.go:229","msg":"Flag IResolver listening at [::]:8013","component":"service"}

@austindrenski austindrenski requested a review from a team as a code owner January 16, 2025 00:53
Copy link

netlify bot commented Jan 16, 2025

Deploy Preview for polite-licorice-3db33c canceled.

Name Link
🔨 Latest commit 19b12f9
🔍 Latest deploy log https://app.netlify.com/sites/polite-licorice-3db33c/deploys/678a57bc3250730008ae796e

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jan 16, 2025
@austindrenski austindrenski changed the title Skip flagd banner when non-console logger in use fix: Skip flagd banner when non-console logger in use Jan 16, 2025
Signed-off-by: Austin Drenski <austin@austindrenski.io>
@austindrenski austindrenski force-pushed the suppress-console-banner branch from a3fc9f6 to c1d671f Compare January 16, 2025 00:57
@beeme1mr beeme1mr merged commit bae9b6f into open-feature:main Jan 17, 2025
14 checks passed
@github-actions github-actions bot mentioned this pull request Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants