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