Add TestLogger for testing purposes#14
Conversation
b69b9b0 to
c165bb5
Compare
|
I would prefer that log messages are written to the |
| var Disabled Logger = &slog{lvl: LevelOff, b: NewBackend(ioutil.Discard)} | ||
|
|
||
| func init() { | ||
| Disabled = &slog{lvl: LevelOff, b: NewBackend(ioutil.Discard)} |
There was a problem hiding this comment.
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.gofile: