Skip to content

Commit

Permalink
docs: add more details to elapsed (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
dezren39 authored Jan 6, 2024
1 parent 3e6f92a commit e116a63
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions elapsed/elapsed.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import (
// MiddlewareWithFormat returns a middleware that logs the elapsed time of the
// session. It accepts a format string to print the elapsed time.
//
// This must be called as the last middleware in the chain.
// In order to provide an accurate elapsed time for the entire session,
// this must be called as the last middleware in the chain.
func MiddlewareWithFormat(format string) wish.Middleware {
return func(sh ssh.Handler) ssh.Handler {
return func(s ssh.Session) {
Expand All @@ -23,7 +24,8 @@ func MiddlewareWithFormat(format string) wish.Middleware {

// Middleware returns a middleware that logs the elapsed time of the session.
//
// This must be called as the last middleware in the chain.
// In order to provide an accurate elapsed time for the entire session,
// this must be called as the last middleware in the chain.
func Middleware() wish.Middleware {
return MiddlewareWithFormat("elapsed time: %v\n")
}

0 comments on commit e116a63

Please sign in to comment.