From f30ff25fb7e208f9fe65f4ae913129b8220d30c1 Mon Sep 17 00:00:00 2001 From: dmathieu <42@dmathieu.com> Date: Tue, 18 Jul 2017 15:18:46 +0200 Subject: [PATCH] rename logrus_syslog package to syslog Package names shouldn't be using underscores. There is also nothing wrong with naming this package `syslog`. People can include it with any name they wish. --- hooks/syslog/README.md | 8 ++++---- hooks/syslog/syslog.go | 5 +++-- hooks/syslog/syslog_test.go | 5 +++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/hooks/syslog/README.md b/hooks/syslog/README.md index 92b391c..1bbc0f7 100644 --- a/hooks/syslog/README.md +++ b/hooks/syslog/README.md @@ -6,12 +6,12 @@ import ( "log/syslog" "github.com/sirupsen/logrus" - logrus_syslog "github.com/sirupsen/logrus/hooks/syslog" + lSyslog "github.com/sirupsen/logrus/hooks/syslog" ) func main() { log := logrus.New() - hook, err := logrus_syslog.NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, "") + hook, err := lSyslog.NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, "") if err == nil { log.Hooks.Add(hook) @@ -25,12 +25,12 @@ If you want to connect to local syslog (Ex. "/dev/log" or "/var/run/syslog" or " import ( "log/syslog" "github.com/sirupsen/logrus" - logrus_syslog "github.com/sirupsen/logrus/hooks/syslog" + lSyslog "github.com/sirupsen/logrus/hooks/syslog" ) func main() { log := logrus.New() - hook, err := logrus_syslog.NewSyslogHook("", "", syslog.LOG_INFO, "") + hook, err := lSyslog.NewSyslogHook("", "", syslog.LOG_INFO, "") if err == nil { log.Hooks.Add(hook) diff --git a/hooks/syslog/syslog.go b/hooks/syslog/syslog.go index 204f001..329ce0d 100644 --- a/hooks/syslog/syslog.go +++ b/hooks/syslog/syslog.go @@ -1,12 +1,13 @@ // +build !windows,!nacl,!plan9 -package logrus_syslog +package syslog import ( "fmt" - "github.com/sirupsen/logrus" "log/syslog" "os" + + "github.com/sirupsen/logrus" ) // SyslogHook to send logs via syslog. diff --git a/hooks/syslog/syslog_test.go b/hooks/syslog/syslog_test.go index 8d7fbe4..5ec3a44 100644 --- a/hooks/syslog/syslog_test.go +++ b/hooks/syslog/syslog_test.go @@ -1,9 +1,10 @@ -package logrus_syslog +package syslog import ( - "github.com/sirupsen/logrus" "log/syslog" "testing" + + "github.com/sirupsen/logrus" ) func TestLocalhostAddAndPrint(t *testing.T) {