Skip to content

Commit 53c4e0a

Browse files
committed
add couple of convenience logging fuctions
1 parent 72a8825 commit 53c4e0a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

logging.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ type Logger interface {
3030
Printf(format string, a ...interface{})
3131
}
3232

33+
// SenderInfo is the convenience function to log the sender info in the context.
34+
func SenderInfo(c tb.Context) string {
35+
return Userinfo(c.Sender())
36+
}
37+
3338
// Userinfo returns the user info.
3439
func Userinfo(u *tb.User) string {
3540
if u == nil {

0 commit comments

Comments
 (0)