Associate this example with what it's an example for

This commit is contained in:
Edward Muller 2019-10-13 17:41:41 -07:00
parent 39a5ad1294
commit f9951ccddd
No known key found for this signature in database
GPG Key ID: FC5833DB021899A5
3 changed files with 7 additions and 5 deletions

View File

@ -9,7 +9,7 @@ import (
"github.com/sirupsen/logrus"
)
func ExampleCustomFormatter() {
func ExampleJSONFormatter_CallerPrettyfier() {
l := logrus.New()
l.SetReportCaller(true)
l.Out = os.Stdout

View File

@ -1,8 +1,9 @@
package logrus_test
import (
"github.com/sirupsen/logrus"
"os"
"github.com/sirupsen/logrus"
)
type DefaultFieldHook struct {
@ -18,7 +19,7 @@ func (h *DefaultFieldHook) Fire(e *logrus.Entry) error {
return nil
}
func ExampleDefaultField() {
func ExampleDefaultFieldHook() {
l := logrus.New()
l.Out = os.Stdout
l.Formatter = &logrus.TextFormatter{DisableTimestamp: true, DisableColors: true}

View File

@ -1,8 +1,9 @@
package logrus_test
import (
"github.com/sirupsen/logrus"
"os"
"github.com/sirupsen/logrus"
)
var (
@ -21,7 +22,7 @@ func (h *GlobalHook) Fire(e *logrus.Entry) error {
return nil
}
func ExampleGlobalVariableHook() {
func ExampleGlobalHook() {
l := logrus.New()
l.Out = os.Stdout
l.Formatter = &logrus.TextFormatter{DisableTimestamp: true, DisableColors: true}