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

client.go: allow transaction logs to use a specific logger #361

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

flavio-fernandes
Copy link
Contributor

Provide an option to logger to explictly direct transactions logs. When not specified, client.logger remains as the used logger.

Reported-at: https://issues.redhat.com/browse/SDN-3507

@flavio-fernandes
Copy link
Contributor Author

/assign @jcaamano

Provide an option to logger to explictly direct transactions
logs. When not specified, client.logger remains as the used
logger.

Reported-at: https://issues.redhat.com/browse/SDN-3507
Signed-off-by: Flavio Fernandes <flaviof@redhat.com>
@flavio-fernandes
Copy link
Contributor Author

/hold
let's rehash this a bit more before going ahead with this.
Turning this PR into draft

@flavio-fernandes flavio-fernandes marked this pull request as draft August 7, 2023 15:42
if dbgLogger.Enabled() {
dbgLogger.Info("transacting operations", "operations", fmt.Sprintf("%+v", operation))
// Use dedicated logger for providing transactions.
if o.txnLogger.Enabled() {
Copy link
Contributor

Choose a reason for hiding this comment

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

How about injecting the logger from context? If so we can share a client and let different Transact calls use different log contexts.

something like log.FrromContext

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.

None yet

2 participants