Skip to content

Commit df2a5c2

Browse files
author
Andreas Kluth
committed
Fixed typo.
1 parent 3d5fe4e commit df2a5c2

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

helper.go

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"github.com/sirupsen/logrus"
1313
)
1414

15-
// The of cookies which should not be logged
15+
// AccessLogCookiesBlacklist The of cookies which should not be logged
1616
var AccessLogCookiesBlacklist = []string{}
1717

1818
var LifecycleEnvVars = []string{"BUILD_NUMBER", "BUILD_HASH", "BUILD_DATE"}
@@ -111,7 +111,7 @@ func Call(r *http.Request, resp *http.Response, start time.Time, err error) {
111111
logCall(fields, r, resp, err)
112112
}
113113

114-
// Call logs the result of an outgoing call and marks it as flaky
114+
// FlakyCall logs the result of an outgoing call and marks it as flaky
115115
func FlakyCall(r *http.Request, resp *http.Response, start time.Time, err error) {
116116
fields := fieldsForCall(r, resp, start, err)
117117
fields["flaky"] = true
@@ -170,7 +170,7 @@ func logCall(fields logrus.Fields, r *http.Request, resp *http.Response, err err
170170
Log.WithFields(fields).Warn("call, but no response given")
171171
}
172172

173-
// Cacheinfo logs the hit information a accessing a ressource
173+
// Cacheinfo logs the hit information a accessing a resource
174174
func Cacheinfo(url string, hit bool) {
175175
var msg string
176176
if hit {
@@ -187,7 +187,7 @@ func Cacheinfo(url string, hit bool) {
187187
Debug(msg)
188188
}
189189

190-
// Return a log entry for application logs,
190+
// Application Return a log entry for application logs,
191191
// prefilled with the correlation ids out of the supplied request.
192192
func Application(h http.Header) *Entry {
193193
fields := logrus.Fields{
@@ -198,7 +198,7 @@ func Application(h http.Header) *Entry {
198198
}
199199

200200
// LifecycleStart logs the start of an application
201-
// with the configuration struct or map as paramter.
201+
// with the configuration struct or map as parameter.
202202
func LifecycleStart(appName string, args interface{}) {
203203
fields := logrus.Fields{}
204204

@@ -244,10 +244,20 @@ func LifecycleStop(appName string, signal os.Signal, err error) {
244244
}
245245

246246
// LifecycleStoped logs the stop of an application
247+
// Deprecated: Typo in name LifecycleStoped, please use LifecycleStopped instead.
247248
func LifecycleStoped(appName string, err error) {
249+
logApplicationLifecycleEvent(appName, "stoped", err)
250+
}
251+
252+
// LifecycleStopped logs the stop of an application
253+
func LifecycleStopped(appName string, err error) {
254+
logApplicationLifecycleEvent(appName, "stopped", err)
255+
}
256+
257+
func logApplicationLifecycleEvent(appName string, eventName string, err error) {
248258
fields := logrus.Fields{
249259
"type": "lifecycle",
250-
"event": "stoped",
260+
"event": eventName,
251261
}
252262

253263
if os.Getenv("BUILD_NUMBER") != "" {
@@ -259,11 +269,11 @@ func LifecycleStoped(appName string, err error) {
259269
WithError(err).
260270
Errorf("stopping application: %v (%v)", appName, err)
261271
} else {
262-
Log.WithFields(fields).Infof("application stoped: %v", appName)
272+
Log.WithFields(fields).Infof("application %s: %v", eventName, appName)
263273
}
264274
}
265275

266-
// LifecycleStop logs the stop of an application
276+
// ServerClosed logs the clos of an server
267277
func ServerClosed(appName string) {
268278
fields := logrus.Fields{
269279
"type": "application",

0 commit comments

Comments
 (0)