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

Change debugger to write packet via log's Writer (#1) #306

Merged
merged 1 commit into from
Aug 16, 2021

Conversation

almozavr
Copy link
Contributor

Issue

Debugger prints debug-level messages via std log but prints packets via os.Stdout, so it makes impossible to use the Output from the global log, e.g. zap provides single point of configuration even for the global log, so still could be used for libraries logging setup.

Solution

Pass log#Writer() to the ber packet writer func.

Partly resolves #164

Copy link
Contributor

@stefanmcshane stefanmcshane left a comment

Choose a reason for hiding this comment

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

Please apply these changes to debug.go as well as v3/debug.go in order to merge.
Ill review this weekend to get them merged then!

Thanks,
Stefan

Copy link
Member

@johnweldon johnweldon left a comment

Choose a reason for hiding this comment

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

LGTM; please update with master and we'll merge it in.

@almozavr
Copy link
Contributor Author

@johnweldon updated 👍 also, I've prettified commits a bit

Copy link
Member

@johnweldon johnweldon left a comment

Choose a reason for hiding this comment

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

LGTM; thank you!

@johnweldon johnweldon merged commit f61ea45 into go-ldap:master Aug 16, 2021
@lozbrown
Copy link

@johnweldon @almozavr

This change seems to have broken an automated install for me, the go get command now gives the following error.

"go/src/github.com/go-ldap/ldap/debug.go:28:19: undefined: log.Writer"

@johnweldon
Copy link
Member

This change seems to have broken an automated install for me, the go get command now gives the following error.

"go/src/github.com/go-ldap/ldap/debug.go:28:19: undefined: log.Writer"

can you specify exactly what your go get invocation is, as well as the version of Go you're using?

cpuschma pushed a commit to clementblaise/ldap that referenced this pull request Apr 25, 2022
inv2004 pushed a commit to inv2004/ldap that referenced this pull request Jan 17, 2023
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.

Logging output and levels should be configurable
4 participants