Improve debug support for notifications

Summary: Add a `notification.debug` setting that shows debug info in the browser. Also improve some logging/error handling stuff and fix a bug with host names.

Test Plan: {F13098}

Reviewers: jungejason, btrahan, vrana

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T944

Differential Revision: https://secure.phabricator.com/D2810
This commit is contained in:
epriestley
2012-06-20 13:20:47 -07:00
parent addc2c8764
commit 5e184ee593
8 changed files with 61 additions and 128 deletions

View File

@@ -49,20 +49,6 @@ celerity_register_resource_map(array(
'disk' => '/rsrc/image/custom/example_template.png',
'type' => 'png',
),
'/rsrc/image/facebook/icon/fatcow/speedometer.png' =>
array(
'hash' => '3345a7ba5b3c99dbfa3a922a16756815',
'uri' => '/res/3345a7ba/rsrc/image/facebook/icon/fatcow/speedometer.png',
'disk' => '/rsrc/image/facebook/icon/fatcow/speedometer.png',
'type' => 'png',
),
'/rsrc/image/facebook/icon/sandcastle.png' =>
array(
'hash' => '496a1c2e91ccb8332435491a7bbfa67d',
'uri' => '/res/496a1c2e/rsrc/image/facebook/icon/sandcastle.png',
'disk' => '/rsrc/image/facebook/icon/sandcastle.png',
'type' => 'png',
),
'/rsrc/image/grippy_texture.png' =>
array(
'hash' => 'a8945e12ceeaddd5b491a8d81cfa19c1',
@@ -701,69 +687,6 @@ celerity_register_resource_map(array(
),
'disk' => '/rsrc/css/application/diffusion/diffusion-source.css',
),
'facebook-differential-core-view-css' =>
array(
'uri' => '/res/6053fa4a/rsrc/css/facebook/application/differential/core.css',
'type' => 'css',
'requires' =>
array(
),
'disk' => '/rsrc/css/facebook/application/differential/core.css',
),
'facebook-example-css' =>
array(
'uri' => '/res/6ba49cd8/rsrc/css/facebook/application/example/example.css',
'type' => 'css',
'requires' =>
array(
),
'disk' => '/rsrc/css/facebook/application/example/example.css',
),
'facebook-example-js' =>
array(
'uri' => '/res/31058d06/rsrc/js/facebook/application/example/example.js',
'type' => 'js',
'requires' =>
array(
),
'disk' => '/rsrc/js/facebook/application/example/example.js',
),
'facebook-releeph-branch' =>
array(
'uri' => '/res/6b7eea98/rsrc/css/facebook/application/releeph/releeph-branch.css',
'type' => 'css',
'requires' =>
array(
),
'disk' => '/rsrc/css/facebook/application/releeph/releeph-branch.css',
),
'facebook-releeph-core' =>
array(
'uri' => '/res/c3027f71/rsrc/css/facebook/application/releeph/releeph-core.css',
'type' => 'css',
'requires' =>
array(
),
'disk' => '/rsrc/css/facebook/application/releeph/releeph-core.css',
),
'facebook-releeph-project' =>
array(
'uri' => '/res/497c0c11/rsrc/css/facebook/application/releeph/releeph-project.css',
'type' => 'css',
'requires' =>
array(
),
'disk' => '/rsrc/css/facebook/application/releeph/releeph-project.css',
),
'facebook-releeph-request-typeahead-css' =>
array(
'uri' => '/res/2f4bab97/rsrc/css/facebook/application/releeph/request-typeahead.css',
'type' => 'css',
'requires' =>
array(
),
'disk' => '/rsrc/css/facebook/application/releeph/request-typeahead.css',
),
'files-css' =>
array(
'uri' => '/res/a265a77d/rsrc/css/application/files/files.css',
@@ -856,7 +779,7 @@ celerity_register_resource_map(array(
),
'javelin-behavior-aphlict-listen' =>
array(
'uri' => '/res/da96a861/rsrc/js/application/aphlict/behavior-aphlict-listen.js',
'uri' => '/res/c716b386/rsrc/js/application/aphlict/behavior-aphlict-listen.js',
'type' => 'js',
'requires' =>
array(
@@ -866,7 +789,8 @@ celerity_register_resource_map(array(
3 => 'javelin-request',
4 => 'javelin-uri',
5 => 'javelin-dom',
6 => 'phabricator-notification',
6 => 'javelin-json',
7 => 'phabricator-notification',
),
'disk' => '/rsrc/js/application/aphlict/behavior-aphlict-listen.js',
),
@@ -1239,25 +1163,6 @@ celerity_register_resource_map(array(
),
'disk' => '/rsrc/js/application/core/behavior-error-log.js',
),
'javelin-behavior-facebook-releeph-request-typeahead' =>
array(
'uri' => '/res/585eff76/rsrc/js/facebook/application/releeph/request-typeahead.js',
'type' => 'js',
'requires' =>
array(
0 => 'javelin-behavior',
1 => 'javelin-util',
2 => 'javelin-dom',
3 => 'javelin-typeahead',
4 => 'javelin-tokenizer',
5 => 'javelin-typeahead-preloaded-source',
6 => 'javelin-typeahead-ondemand-source',
7 => 'javelin-dom',
8 => 'javelin-stratcom',
9 => 'javelin-util',
),
'disk' => '/rsrc/js/facebook/application/releeph/request-typeahead.js',
),
'javelin-behavior-fancy-datepicker' =>
array(
'uri' => '/res/b2d89e4c/rsrc/js/application/core/behavior-fancy-datepicker.js',
@@ -2292,7 +2197,7 @@ celerity_register_resource_map(array(
),
'phabricator-notification-css' =>
array(
'uri' => '/res/7452322a/rsrc/css/aphront/notification.css',
'uri' => '/res/1ed48691/rsrc/css/aphront/notification.css',
'type' => 'css',
'requires' =>
array(

View File

@@ -76,8 +76,9 @@ You can run `aphlict` in the foreground to get output to your console:
phabricator/ $ ./bin/aphlict --foreground
This may help identify and resolve problems.
You can set `notification.debug` in your configuration to get additional
output in your browser.
The server also generates a log, by default in `/var/log/aphlict.log`. You can
change this location by changing `notification.log` in your configuration. The
log may contain information useful in resolving issues.
log may contain information useful in resolving issues.

View File

@@ -394,16 +394,20 @@ final class PhabricatorStandardPageView extends AphrontPageView {
$client_uri = PhabricatorEnv::getEnvConfig('notification.client-uri');
$client_uri = new PhutilURI($client_uri);
if ($client_uri->getDomain() == 'localhost') {
$this_host = new PhutilURI($this->getRequest()->getHost());
$this_host = $this->getRequest()->getHost();
$this_host = new PhutilURI('http://'.$this_host.'/');
$client_uri->setDomain($this_host->getDomain());
}
$enable_debug = PhabricatorEnv::getEnvConfig('notification.debug');
Javelin::initBehavior(
'aphlict-listen',
array(
'id' => $aphlict_object_id,
'server' => $client_uri->getDomain(),
'port' => $client_uri->getPort(),
'debug' => $enable_debug,
'pageObjects' => array_fill_keys($this->pageObjects, true),
));