| @@ 405-427 (lines=23) @@ | ||
| 402 | * information about the line of code that is executing |
|
| 403 | * @return void |
|
| 404 | */ |
|
| 405 | public function logPhaseActivity($msg, $codeLine = null) |
|
| 406 | { |
|
| 407 | // enforce our input type |
|
| 408 | Contract::RequiresValue($msg, is_string($msg)); |
|
| 409 | if ($codeLine) { |
|
| 410 | Contract::RequiresValue($codeLine, is_array($codeLine)); |
|
| 411 | } |
|
| 412 | ||
| 413 | // keep track of what was attempted, in case we need to show |
|
| 414 | // the user what was attempted |
|
| 415 | $this->activityLog[] = [ |
|
| 416 | 'ts' => time(), |
|
| 417 | 'text' => $msg, |
|
| 418 | 'codeLine' => $codeLine, |
|
| 419 | 'isOutput' => false, |
|
| 420 | ]; |
|
| 421 | ||
| 422 | // call all of our plugins |
|
| 423 | foreach ($this->plugins as $plugin) |
|
| 424 | { |
|
| 425 | $plugin->logPhaseActivity($msg, $codeLine); |
|
| 426 | } |
|
| 427 | } |
|
| 428 | ||
| 429 | /** |
|
| 430 | * called when a story logs the (possibly partial) output from |
|
| @@ 466-485 (lines=20) @@ | ||
| 463 | * an error message to send to console|logfile |
|
| 464 | * @return void |
|
| 465 | */ |
|
| 466 | public function logPhaseError($phaseName, $msg) |
|
| 467 | { |
|
| 468 | // enforce our inputs |
|
| 469 | Contract::RequiresValue($phaseName, is_string($phaseName)); |
|
| 470 | Contract::RequiresValue($msg, is_string($msg)); |
|
| 471 | ||
| 472 | // keep track of what was attempted, in case we need to show |
|
| 473 | // the user what was attempted |
|
| 474 | $this->activityLog[] = [ |
|
| 475 | 'ts' => time(), |
|
| 476 | 'text' => $msg, |
|
| 477 | 'codeLine' => null, |
|
| 478 | ]; |
|
| 479 | ||
| 480 | // call all of our plugins |
|
| 481 | foreach ($this->plugins as $plugin) |
|
| 482 | { |
|
| 483 | $plugin->logPhaseError($phaseName, $msg); |
|
| 484 | } |
|
| 485 | } |
|
| 486 | ||
| 487 | /** |
|
| 488 | * called when a story is skipped |
|
| @@ 496-515 (lines=20) @@ | ||
| 493 | * an informational message to send to console|logfile |
|
| 494 | * @return void |
|
| 495 | */ |
|
| 496 | public function logPhaseSkipped($phaseName, $msg) |
|
| 497 | { |
|
| 498 | // enforce our inputs |
|
| 499 | Contract::RequiresValue($phaseName, is_string($phaseName)); |
|
| 500 | Contract::RequiresValue($msg, is_string($msg)); |
|
| 501 | ||
| 502 | // keep track of what was attempted, in case we need to show |
|
| 503 | // the user what was attempted |
|
| 504 | $this->activityLog[] = [ |
|
| 505 | 'ts' => time(), |
|
| 506 | 'text' => $msg, |
|
| 507 | 'codeLine' => null, |
|
| 508 | ]; |
|
| 509 | ||
| 510 | // call all of our plugins |
|
| 511 | foreach ($this->plugins as $plugin) |
|
| 512 | { |
|
| 513 | $plugin->logPhaseSkipped($phaseName, $msg); |
|
| 514 | } |
|
| 515 | } |
|
| 516 | ||
| 517 | /** |
|
| 518 | * called when we want to record which line of code in a phase is |
|