Skip to content

Commit

Permalink
Update comments for easier reading in godocs
Browse files Browse the repository at this point in the history
  • Loading branch information
puddingfactory committed Dec 10, 2016
1 parent d3e2f85 commit ec4c103
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Logentrus | a [Logentries](https://logentries.com) hook for [Logrus](https://github.com/sirupsen/logrus) <img src="http://i.imgur.com/hTeVwmJ.png" width="40" height="40" alt=":walrus:" class="emoji" title=":walrus:"/>
# Logentrus | a [Logentries](https://logentries.com) hook for [Logrus](https://github.com/sirupsen/logrus) <img src="http://i.imgur.com/hTeVwmJ.png" width="40" height="40" alt=":walrus:" class="emoji" title=":walrus:"/> [![GoDoc](https://godoc.org/github.com/puddingfactory/logentrus?status.svg)](https://godoc.org/github.com/puddingfactory/logentrus)
*Logrus created by [Simon Eskildsen](http://sirupsen.com)*

# Install
Expand Down
10 changes: 5 additions & 5 deletions logentrus.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package logentrus acts as a Logentries (https://logentries.com) hook
// for Logrus (https://github.com/sirupsen/logrus)
package logentrus

import (
Expand All @@ -23,9 +25,7 @@ const (
port = 443
)

// New creates and returns a new hook to an instance of logger.
// `hook, err := New("2bfbea1e-10c3-4419-bdad-7e6435882e1f", "Jan 2 15:04:05", logrus.InfoLevel, nil)`
// `if err == nil { log.Hooks.Add(hook) }`
// New creates and returns a new hook for use in Logrus
func New(token, timestampFormat string, priority logrus.Level, config *tls.Config) (*Hook, error) {
if token == "" {
return nil, fmt.Errorf("Unable to create new LogentriesHook since a Token is required")
Expand All @@ -42,7 +42,7 @@ func New(token, timestampFormat string, priority logrus.Level, config *tls.Confi
return hook, err
}

// Fire sends entry to Logentries
// Fire formats and sends JSON entry to Logentries service
func (hook *Hook) Fire(entry *logrus.Entry) error {
line, err := hook.format(entry)
if err != nil {
Expand All @@ -69,7 +69,7 @@ func (hook Hook) format(entry *logrus.Entry) (string, error) {
return str, nil
}

// Levels returns the log levels supported by LogentriesHook
// Levels returns the log levels supported by this hook
func (hook *Hook) Levels() []logrus.Level {
return logrus.AllLevels
}

0 comments on commit ec4c103

Please sign in to comment.