summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4f43b89)
raw | patch | inline | side by side (parent: 4f43b89)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 4 Jun 2010 12:30:33 +0000 (12:30 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 4 Jun 2010 12:30:33 +0000 (12:30 +0000) |
-With the new property handling it was ever 0, the used value for debugLevel was ignored.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18846 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18846 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_jsonRPC.inc | patch | blob | history | |
gosa-core/include/functions.inc | patch | blob | history |
index 91f1c2b0a82a57e33ec49432f96151e968317203..247f05411bd07fd1255bec9b35d1c61ab17516ba 100644 (file)
class jsonRPC {
private $curlHandler = NULL;
- private $debug;
private $config;
private $id;
private $lastStats = array();
private $lastAction = "none";
- public function __construct($config, $debug = false)
+ public function __construct($config)
{
$this->config = $config;
- $this->debug = $debug;
$this->id = 0;
$this->__login();
}
// Try to login
$this->login($user, $passwd);
+
+ DEBUG (DEBUG_RPC, __LINE__, __FUNCTION__, __FILE__,"RPC Login ".$this->get_error() , "Login");
}
index 7bc65e5260293730246dcd4b29c83c0014ee6417..829f7dce7f095666ba090cec81ceb50cf1f102fd 100644 (file)
define ("DEBUG_SI", 256); /*! Debug level for communication with gosa-si */
define ("DEBUG_MAIL", 512); /*! Debug level for all about mail (mailAccounts, imap, sieve etc.) */
define ("DEBUG_FAI", 1024); // FAI (incomplete)
+define ("DEBUG_RPC", 2048); /*! Debug level for communication with remote procedures */
/* Rewrite german 'umlauts' and spanish 'accents'
to get better results */
* */
function DEBUG($level, $line, $function, $file, $data, $info="")
{
- if (session::global_get('debugLevel') & $level){
- $output= "DEBUG[$level] ";
- if ($function != ""){
- $output.= "($file:$function():$line) - $info: ";
- } else {
- $output.= "($file:$line) - $info: ";
- }
- echo $output;
- if (is_array($data)){
- print_a($data);
- } else {
- echo "'$data'";
+ global $config;
+ $debugLevel = 0;
+ if($config instanceOf config){
+ $debugLevel = $config->get_cfg_value('core', 'debugLevel');
+ }
+ if ($debugLevel & $level){
+ $output= "DEBUG[$level] ";
+ if ($function != ""){
+ $output.= "($file:$function():$line) - $info: ";
+ } else {
+ $output.= "($file:$line) - $info: ";
+ }
+ echo $output;
+ if (is_array($data)){
+ print_a($data);
+ } else {
+ echo "'$data'";
+ }
+ echo "<br>";
}
- echo "<br>";
- }
}