LogCommandExecute logs the execution of a command.
(commandRange *storepb.Range, commandText string)
| 287 | |
| 288 | // LogCommandExecute logs the execution of a command. |
| 289 | func (o *ExecuteOptions) LogCommandExecute(commandRange *storepb.Range, commandText string) { |
| 290 | if o == nil || o.CreateTaskRunLog == nil { |
| 291 | return |
| 292 | } |
| 293 | ce := &storepb.TaskRunLog_CommandExecute{} |
| 294 | if o.LogCommandStatement { |
| 295 | ce.Statement = commandText |
| 296 | } else { |
| 297 | ce.Range = commandRange |
| 298 | } |
| 299 | err := o.CreateTaskRunLog(time.Now(), &storepb.TaskRunLog{ |
| 300 | Type: storepb.TaskRunLog_COMMAND_EXECUTE, |
| 301 | CommandExecute: ce, |
| 302 | }) |
| 303 | if err != nil { |
| 304 | slog.Warn("failed to log command execute", log.BBError(err)) |
| 305 | } |
| 306 | } |
| 307 | |
| 308 | func (o *ExecuteOptions) LogCommandResponse(affectedRows int64, allAffectedRows []int64, rerr string) { |
| 309 | if o == nil || o.CreateTaskRunLog == nil { |
no test coverage detected