Skip to content

Commit 3d6a68d

Browse files
authored
Merge pull request beego#3535 from gadelkareem/develop
Make LogAccess() function public
2 parents 387d387 + 8995b29 commit 3d6a68d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ func (c *Controller) viewPath() string {
291291

292292
// Redirect sends the redirection response to url with status code.
293293
func (c *Controller) Redirect(url string, code int) {
294-
logAccess(c.Ctx, nil, code)
294+
LogAccess(c.Ctx, nil, code)
295295
c.Ctx.Redirect(code, url)
296296
}
297297

error.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ func exception(errCode string, ctx *context.Context) {
435435

436436
func executeError(err *errorInfo, ctx *context.Context, code int) {
437437
//make sure to log the error in the access log
438-
logAccess(ctx, nil, code)
438+
LogAccess(ctx, nil, code)
439439

440440
if err.errorType == errorTypeHandler {
441441
ctx.ResponseWriter.WriteHeader(code)

router.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,7 @@ Admin:
889889
statusCode = 200
890890
}
891891

892-
logAccess(context, &startTime, statusCode)
892+
LogAccess(context, &startTime, statusCode)
893893

894894
timeDur := time.Since(startTime)
895895
context.ResponseWriter.Elapsed = timeDur
@@ -980,7 +980,7 @@ func toURL(params map[string]string) string {
980980
return strings.TrimRight(u, "&")
981981
}
982982

983-
func logAccess(ctx *beecontext.Context, startTime *time.Time, statusCode int) {
983+
func LogAccess(ctx *beecontext.Context, startTime *time.Time, statusCode int) {
984984
//Skip logging if AccessLogs config is false
985985
if !BConfig.Log.AccessLogs {
986986
return

0 commit comments

Comments
 (0)