-
Notifications
You must be signed in to change notification settings - Fork 70
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
Add TestLogger for testing purposes #14
base: master
Are you sure you want to change the base?
Conversation
b69b9b0
to
c165bb5
Compare
I would prefer that log messages are written to the |
|
||
func init() { | ||
Disabled = &slog{lvl: LevelOff, b: NewBackend(ioutil.Discard)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fyi, this was done just to remove some ugly from the godoc page which would otherwise show the variable initialized to an unexported type, which isn't super helpful
Also with the explicit type attached? Let me check that tomorrow.
…On 5 Dec 2017 19:26, "Josh Rickmar" ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In log.go
<#14 (comment)>:
>
-func init() {
- Disabled = &slog{lvl: LevelOff, b: NewBackend(ioutil.Discard)}
fyi, this was done just to remove some ugly from the godoc page which
would otherwise show the variable initialized to an unexported type, which
isn't super helpful
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#14 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA0F3EcfzQrBVu_cNthZ-r_AZ2lCorY4ks5s9YphgaJpZM4Q2kJH>
.
|
also, this should already be possible from a test file with something like:
which is the same number of lines as what it would require with this patch. After considering what I really want though, which is to write to the |
When unit testing a subpackage, it's often useful to see log messages.
For this, it would be possible to add something like this in a
_test.go
file: