improves user change logging
authorPhilipp Schüle <p.schuele@metaways.de>
Fri, 8 Aug 2014 14:34:05 +0000 (16:34 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Sat, 9 Aug 2014 15:02:49 +0000 (17:02 +0200)
Change-Id: I6cdf4567da5506312cd5292beda57c60dcbc4b92
Reviewed-on: http://gerrit.tine20.com/customers/954
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/Core.php

index ada159a..e73b462 100644 (file)
@@ -1354,10 +1354,16 @@ class Tinebase_Core
             if ($value === null) {
                 throw new Tinebase_Exception_InvalidArgument('Invalid user object!');
             }
             if ($value === null) {
                 throw new Tinebase_Exception_InvalidArgument('Invalid user object!');
             }
-            if ($value instanceof Tinebase_Model_FullUser) {
-                Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__ . ' Setting user ' . $value->accountLoginName);
-            } else {
-                Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__ . ' Setting user ' . var_export($value, true));
+            if (Tinebase_Core::isLogLevel(Zend_Log::INFO)) {
+                if ($value instanceof Tinebase_Model_FullUser) {
+                    $userString =  $value->accountLoginName;
+                } else if ($value instanceof Tinebase_Model_User) {
+                    $userString = $value->accountDisplayName;
+                } else {
+                    $userString = var_export($value, true);
+                }
+                
+                Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__ . ' Setting user ' . $userString);
             }
         }
         
             }
         }