diff options
Diffstat (limited to 'service/logging.go')
-rw-r--r-- | service/logging.go | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/service/logging.go b/service/logging.go index 86aa1cb..055dadd 100644 --- a/service/logging.go +++ b/service/logging.go @@ -77,7 +77,7 @@ func (s *ls) ServeNotificationPage(ctx context.Context, c *model.Client, return s.Service.ServeNotificationPage(ctx, c, maxID, minID) } -func (s *ls) ServeUserPage(ctx context.Context, c *model.Client, id string, +func (s *ls) ServeUserPage(ctx context.Context, c *model.Client, id string, pageType string, maxID string, minID string) (err error) { defer func(begin time.Time) { s.logger.Printf("method=%v, id=%v, type=%v, took=%v, err=%v\n", @@ -111,7 +111,7 @@ func (s *ls) ServeSearchPage(ctx context.Context, c *model.Client, q string, return s.Service.ServeSearchPage(ctx, c, q, qType, offset) } -func (s *ls) ServeUserSearchPage(ctx context.Context, c *model.Client, +func (s *ls) ServeUserSearchPage(ctx context.Context, c *model.Client, id string, q string, offset int) (err error) { defer func(begin time.Time) { s.logger.Printf("method=%v, took=%v, err=%v\n", @@ -189,6 +189,14 @@ func (s *ls) UnRetweet(ctx context.Context, c *model.Client, id string) (count i return s.Service.UnRetweet(ctx, c, id) } +func (s *ls) Vote(ctx context.Context, c *model.Client, id string, choices []string) (err error) { + defer func(begin time.Time) { + s.logger.Printf("method=%v, id=%v, took=%v, err=%v\n", + "Vote", id, time.Since(begin), err) + }(time.Now()) + return s.Service.Vote(ctx, c, id, choices) +} + func (s *ls) Follow(ctx context.Context, c *model.Client, id string) (err error) { defer func(begin time.Time) { s.logger.Printf("method=%v, id=%v, took=%v, err=%v\n", @@ -205,6 +213,38 @@ func (s *ls) UnFollow(ctx context.Context, c *model.Client, id string) (err erro return s.Service.UnFollow(ctx, c, id) } +func (s *ls) Mute(ctx context.Context, c *model.Client, id string) (err error) { + defer func(begin time.Time) { + s.logger.Printf("method=%v, id=%v, took=%v, err=%v\n", + "Mute", id, time.Since(begin), err) + }(time.Now()) + return s.Service.Mute(ctx, c, id) +} + +func (s *ls) UnMute(ctx context.Context, c *model.Client, id string) (err error) { + defer func(begin time.Time) { + s.logger.Printf("method=%v, id=%v, took=%v, err=%v\n", + "UnMute", id, time.Since(begin), err) + }(time.Now()) + return s.Service.UnMute(ctx, c, id) +} + +func (s *ls) Block(ctx context.Context, c *model.Client, id string) (err error) { + defer func(begin time.Time) { + s.logger.Printf("method=%v, id=%v, took=%v, err=%v\n", + "Block", id, time.Since(begin), err) + }(time.Now()) + return s.Service.Block(ctx, c, id) +} + +func (s *ls) UnBlock(ctx context.Context, c *model.Client, id string) (err error) { + defer func(begin time.Time) { + s.logger.Printf("method=%v, id=%v, took=%v, err=%v\n", + "UnBlock", id, time.Since(begin), err) + }(time.Now()) + return s.Service.UnBlock(ctx, c, id) +} + func (s *ls) SaveSettings(ctx context.Context, c *model.Client, settings *model.Settings) (err error) { defer func(begin time.Time) { s.logger.Printf("method=%v, took=%v, err=%v\n", |