private function importRemainingChangesets(Tracker_Artifact $artifact, array $xml_changesets, Tracker_Artifact_XMLImport_ArtifactFieldsDataBuilder $fields_data_builder) { $count = 0; $this->logger->push('art #' . $artifact->getId()); foreach ($xml_changesets as $xml_changeset) { try { $count++; $this->logger->push("changeset {$count}"); $initial_comment_body = ''; $initial_comment_format = Tracker_Artifact_Changeset_Comment::TEXT_COMMENT; if (isset($xml_changeset->comments) && count($xml_changeset->comments->comment) > 0) { $initial_comment_body = (string) $xml_changeset->comments->comment[0]->body; $initial_comment_format = (string) $xml_changeset->comments->comment[0]->body['format']; } $submitted_by = $this->getSubmittedBy($xml_changeset); $changeset = $this->new_changeset_creator->create($artifact, $fields_data_builder->getFieldsData($xml_changeset, $submitted_by), $initial_comment_body, $submitted_by, $this->getSubmittedOn($xml_changeset), $this->send_notifications, $initial_comment_format); if ($changeset) { $this->updateComments($changeset, $xml_changeset); } else { $this->logger->warn("Impossible to create changeset {$count}: " . $GLOBALS['Response']->getAndClearRawFeedback()); } $this->logger->pop(); } catch (Tracker_NoChangeException $exception) { $this->logger->warn("No Change for changeset {$count}"); $this->logger->pop(); } catch (Exception $exception) { $this->logger->warn("Unexpected error at changeset {$count}: " . $exception->getMessage()); $this->logger->pop(); } } $this->logger->pop(); }
public function itPopPrefixes2() { $wrapper = new WrapperLogger($this->logger, 'tracker'); expect($this->logger)->info()->count(3); expect($this->logger)->info('[tracker] stuff')->at(0); expect($this->logger)->info('[tracker][53] bla')->at(1); expect($this->logger)->info('[tracker][54] coin')->at(2); $wrapper->info('stuff'); $wrapper->push('53'); $wrapper->info('bla'); $wrapper->pop(); $wrapper->push('54'); $wrapper->info('coin'); }