--- nfo/php/libs/org.netfrag.glib/DesignPattern/RemoteProxy.php 2003/03/28 03:05:54 1.10 +++ nfo/php/libs/org.netfrag.glib/DesignPattern/RemoteProxy.php 2003/03/28 06:44:51 1.11 @@ -15,9 +15,12 @@ * *
* ------------------------------------------------------------------------- - * $Id: RemoteProxy.php,v 1.10 2003/03/28 03:05:54 joko Exp $ + * $Id: RemoteProxy.php,v 1.11 2003/03/28 06:44:51 joko Exp $ * ------------------------------------------------------------------------- * $Log: RemoteProxy.php,v $ + * Revision 1.11 2003/03/28 06:44:51 joko + * VERBOSE mode + * * Revision 1.10 2003/03/28 03:05:54 joko * more fancy debugging-output * @@ -513,22 +516,24 @@ $status = $this->backend->getStatus(); //print Dumper($status); - $style = html_style("text/css", '.caption { color: yellow }'); - - $statusbox = html_div(); - $statusbox->set_style('background: #558856; border: 2px black groove; width:640px; padding:10px; margin:40px;'); - $statusbox->add( html_b("Connected:"), $status[connected], html_br() ); - $statusbox->add( html_span('caption', "Connected:"), $status[connected], html_br() ); - foreach ($status[errors] as $error) { - $statusbox->add( html_span('caption', "Error[$error[code]]:"), $error[message], html_br() ); + if (constants::get('VERBOSE')) { + $style = html_style("text/css", '.boxlabel_yellow { color: yellow; font-weight:bold; }'); + $statusbox = html_div(); + $statusbox->set_style('background: #558856; border: 2px black groove; width:640px; padding:10px; margin:40px;'); + $statusbox->add( html_span('boxlabel_yellow', "Connected:"), $status[connected], html_br() ); + foreach ($status[errors] as $error) { + $statusbox->add( html_span('boxlabel_yellow', "Error($error[code]):"), $error[message], html_br() ); + } } if (is_array($result)) { $good = 1; } else { $message = get_class($this) . "->_loadRemote: Error while trying to talk to remote side. Please check wire, socket or api."; - $statusbox->add( $message, html_br() ); logp($message, PEAR_LOG_CRIT); + if (constants::get('VERBOSE')) { + $statusbox->add( html_span('boxlabel_yellow', "Critical:"), $message, html_br() ); + } } if ($good && sizeof($result)) { @@ -546,8 +551,14 @@ $this->flushState(); } else { - print $style->render(); - print $statusbox->render(); + if (constants::get('VERBOSE')) { + print $style->render(); + print $statusbox->render(); + } else { + foreach ($status[errors] as $error) { + print Dumper($error); + } + } }