Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14004744
D18646.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D18646.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -171,16 +171,21 @@
'PhutilCommandString' => 'xsprintf/PhutilCommandString.php',
'PhutilConsole' => 'console/PhutilConsole.php',
'PhutilConsoleBlock' => 'console/view/PhutilConsoleBlock.php',
+ 'PhutilConsoleError' => 'console/view/PhutilConsoleError.php',
'PhutilConsoleFormatter' => 'console/PhutilConsoleFormatter.php',
+ 'PhutilConsoleInfo' => 'console/view/PhutilConsoleInfo.php',
'PhutilConsoleList' => 'console/view/PhutilConsoleList.php',
+ 'PhutilConsoleLogLine' => 'console/view/PhutilConsoleLogLine.php',
'PhutilConsoleMessage' => 'console/PhutilConsoleMessage.php',
'PhutilConsoleProgressBar' => 'console/PhutilConsoleProgressBar.php',
'PhutilConsoleServer' => 'console/PhutilConsoleServer.php',
'PhutilConsoleServerChannel' => 'console/PhutilConsoleServerChannel.php',
+ 'PhutilConsoleSkip' => 'console/view/PhutilConsoleSkip.php',
'PhutilConsoleStdinNotInteractiveException' => 'console/PhutilConsoleStdinNotInteractiveException.php',
'PhutilConsoleSyntaxHighlighter' => 'markup/syntax/highlighter/PhutilConsoleSyntaxHighlighter.php',
'PhutilConsoleTable' => 'console/view/PhutilConsoleTable.php',
'PhutilConsoleView' => 'console/view/PhutilConsoleView.php',
+ 'PhutilConsoleWarning' => 'console/view/PhutilConsoleWarning.php',
'PhutilConsoleWrapTestCase' => 'console/__tests__/PhutilConsoleWrapTestCase.php',
'PhutilContextFreeGrammar' => 'grammar/PhutilContextFreeGrammar.php',
'PhutilCowsay' => 'utils/PhutilCowsay.php',
@@ -788,16 +793,21 @@
'PhutilCommandString' => 'Phobject',
'PhutilConsole' => 'Phobject',
'PhutilConsoleBlock' => 'PhutilConsoleView',
+ 'PhutilConsoleError' => 'PhutilConsoleLogLine',
'PhutilConsoleFormatter' => 'Phobject',
+ 'PhutilConsoleInfo' => 'PhutilConsoleLogLine',
'PhutilConsoleList' => 'PhutilConsoleView',
+ 'PhutilConsoleLogLine' => 'PhutilConsoleView',
'PhutilConsoleMessage' => 'Phobject',
'PhutilConsoleProgressBar' => 'Phobject',
'PhutilConsoleServer' => 'Phobject',
'PhutilConsoleServerChannel' => 'PhutilChannelChannel',
+ 'PhutilConsoleSkip' => 'PhutilConsoleLogLine',
'PhutilConsoleStdinNotInteractiveException' => 'Exception',
'PhutilConsoleSyntaxHighlighter' => 'Phobject',
'PhutilConsoleTable' => 'PhutilConsoleView',
'PhutilConsoleView' => 'Phobject',
+ 'PhutilConsoleWarning' => 'PhutilConsoleLogLine',
'PhutilConsoleWrapTestCase' => 'PhutilTestCase',
'PhutilContextFreeGrammar' => 'Phobject',
'PhutilCowsay' => 'Phobject',
diff --git a/src/console/view/PhutilConsoleError.php b/src/console/view/PhutilConsoleError.php
new file mode 100644
--- /dev/null
+++ b/src/console/view/PhutilConsoleError.php
@@ -0,0 +1,10 @@
+<?php
+
+final class PhutilConsoleError
+ extends PhutilConsoleLogLine {
+
+ protected function getLogLineColor() {
+ return 'red';
+ }
+
+}
diff --git a/src/console/view/PhutilConsoleInfo.php b/src/console/view/PhutilConsoleInfo.php
new file mode 100644
--- /dev/null
+++ b/src/console/view/PhutilConsoleInfo.php
@@ -0,0 +1,10 @@
+<?php
+
+final class PhutilConsoleInfo
+ extends PhutilConsoleLogLine {
+
+ protected function getLogLineColor() {
+ return 'green';
+ }
+
+}
diff --git a/src/console/view/PhutilConsoleLogLine.php b/src/console/view/PhutilConsoleLogLine.php
new file mode 100644
--- /dev/null
+++ b/src/console/view/PhutilConsoleLogLine.php
@@ -0,0 +1,24 @@
+<?php
+
+abstract class PhutilConsoleLogLine extends PhutilConsoleView {
+
+ private $kind;
+ private $message;
+
+ abstract protected function getLogLineColor();
+
+ public function __construct($kind, $message) {
+ $this->kind = $kind;
+ $this->message = $message;
+ }
+
+ protected function drawView() {
+ $color = $this->getLogLineColor();
+
+ return tsprintf(
+ "<bg:".$color.">** %s **</bg> %s\n",
+ $this->kind,
+ $this->message);
+ }
+
+}
diff --git a/src/console/view/PhutilConsoleSkip.php b/src/console/view/PhutilConsoleSkip.php
new file mode 100644
--- /dev/null
+++ b/src/console/view/PhutilConsoleSkip.php
@@ -0,0 +1,10 @@
+<?php
+
+final class PhutilConsoleSkip
+ extends PhutilConsoleLogLine {
+
+ protected function getLogLineColor() {
+ return 'blue';
+ }
+
+}
diff --git a/src/console/view/PhutilConsoleWarning.php b/src/console/view/PhutilConsoleWarning.php
new file mode 100644
--- /dev/null
+++ b/src/console/view/PhutilConsoleWarning.php
@@ -0,0 +1,10 @@
+<?php
+
+final class PhutilConsoleWarning
+ extends PhutilConsoleLogLine {
+
+ protected function getLogLineColor() {
+ return 'yellow';
+ }
+
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Oct 28, 2:04 AM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6740528
Default Alt Text
D18646.diff (4 KB)
Attached To
Mode
D18646: Provide ConsoleView classes for "[ OKAY ] Good things happened." console lines
Attached
Detach File
Event Timeline
Log In to Comment