@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Provide a convenient way to log arbitrary text in Drydock without needing structured log classes

Summary: Depends on D19673. Ref T13197. See PHI873.

Test Plan:
Added some code like this:

```
$operation->logText('Nice convenient text logging.');
```

...then got:

{F5887712}

Reviewers: amckinley

Reviewed By: amckinley

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13197

Differential Revision: https://secure.phabricator.com/D19674

+37
+2
src/__phutil_library_map__.php
··· 1206 1206 'DrydockSlotLockException' => 'applications/drydock/exception/DrydockSlotLockException.php', 1207 1207 'DrydockSlotLockFailureLogType' => 'applications/drydock/logtype/DrydockSlotLockFailureLogType.php', 1208 1208 'DrydockTestRepositoryOperation' => 'applications/drydock/operation/DrydockTestRepositoryOperation.php', 1209 + 'DrydockTextLogType' => 'applications/drydock/logtype/DrydockTextLogType.php', 1209 1210 'DrydockWebrootInterface' => 'applications/drydock/interface/webroot/DrydockWebrootInterface.php', 1210 1211 'DrydockWorker' => 'applications/drydock/worker/DrydockWorker.php', 1211 1212 'DrydockWorkingCopyBlueprintImplementation' => 'applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php', ··· 6620 6621 'DrydockSlotLockException' => 'Exception', 6621 6622 'DrydockSlotLockFailureLogType' => 'DrydockLogType', 6622 6623 'DrydockTestRepositoryOperation' => 'DrydockRepositoryOperationType', 6624 + 'DrydockTextLogType' => 'DrydockLogType', 6623 6625 'DrydockWebrootInterface' => 'DrydockInterface', 6624 6626 'DrydockWorker' => 'PhabricatorWorker', 6625 6627 'DrydockWorkingCopyBlueprintImplementation' => 'DrydockBlueprintImplementation',
+27
src/applications/drydock/logtype/DrydockTextLogType.php
··· 1 + <?php 2 + 3 + /** 4 + * Simple convenience log type for logging arbitrary text. 5 + * 6 + * Drydock logs can be given formal types, which allows them to be translated 7 + * and filtered. If you don't particularly care about fancy logging features, 8 + * you can use this log type to just dump some text into the log. Maybe you 9 + * could upgrade to more formal logging later. 10 + */ 11 + final class DrydockTextLogType extends DrydockLogType { 12 + 13 + const LOGCONST = 'core.text'; 14 + 15 + public function getLogTypeName() { 16 + return pht('Text'); 17 + } 18 + 19 + public function getLogTypeIcon(array $data) { 20 + return 'fa-file-text-o grey'; 21 + } 22 + 23 + public function renderLog(array $data) { 24 + return idx($data, 'text'); 25 + } 26 + 27 + }
+8
src/applications/drydock/storage/DrydockRepositoryOperation.php
··· 203 203 return $this->getProperty('exec.workingcopy.error'); 204 204 } 205 205 206 + public function logText($text) { 207 + return $this->logEvent( 208 + DrydockTextLogType::LOGCONST, 209 + array( 210 + 'text' => $text, 211 + )); 212 + } 213 + 206 214 public function logEvent($type, array $data = array()) { 207 215 $log = id(new DrydockLog()) 208 216 ->setEpoch(PhabricatorTime::getNow())