File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -406,10 +406,25 @@ func (c *Context) executeParsed() (string, error) {
406406 var buf bytes.Buffer
407407 w := LimitWriter (& buf , 25000 )
408408
409- // started := time.Now()
409+ started := time .Now ()
410+ logger .WithFields (logrus.Fields {
411+ "guild_id" : c .GS .ID ,
412+ "cc_id" : c .Data ["CCID" ],
413+ "executed_from" : c .ExecutedFrom ,
414+ }).Info ("Template execution started" )
410415 err := parsed .Execute (w , c .Data )
411416
412- // dur := time.Since(started)
417+ defer func () {
418+ dur := time .Since (started )
419+ logger .WithFields (logrus.Fields {
420+ "guild_id" : c .GS .ID ,
421+ "executed_from" : c .ExecutedFrom ,
422+ "cc_id" : c .Data ["CCID" ],
423+ "success" : err == nil ,
424+ "duration" : dur ,
425+ }).Info ("Template execution finished" )
426+ }()
427+
413428 if c .FixedOutput != "" {
414429 return c .FixedOutput , nil
415430 }
You can’t perform that action at this time.
0 commit comments