From 3f9ac6405a4823349e30be1f9d874ce813ae53f0 Mon Sep 17 00:00:00 2001 From: Frank Karlitschek Date: Tue, 1 May 2012 14:29:34 +0200 Subject: [PATCH] port some of the log call to the new public api more to come --- apps/gallery/lib/hooks_handlers.php | 4 ++-- apps/media/lib_scanner.php | 8 ++++---- apps/media/server/xml.server.php | 2 +- apps/user_migrate/admin.php | 4 ++-- apps/user_openid/appinfo/app.php | 14 +++++++------- apps/user_openid/user.php | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/apps/gallery/lib/hooks_handlers.php b/apps/gallery/lib/hooks_handlers.php index 178d8f3da1..737c38c059 100644 --- a/apps/gallery/lib/hooks_handlers.php +++ b/apps/gallery/lib/hooks_handlers.php @@ -52,7 +52,7 @@ class OC_Gallery_Hooks_Handlers { if ($new_album_name == '') $new_album_name = 'main'; - OC_Log::write(self::$APP_TAG, 'Creating new album '.$new_album_name, OC_Log::DEBUG); + OCP\Util::writeLog(self::$APP_TAG, 'Creating new album '.$new_album_name, OC_Log::DEBUG); OC_Gallery_Album::create(OC_User::getUser(), $new_album_name, $path); return OC_Gallery_Album::find(OC_User::getUser(), null, $path); @@ -110,7 +110,7 @@ class OC_Gallery_Hooks_Handlers { if ($olddir == '') $olddir = '/'; if ($newdir == '') $newdir = '/'; if (!self::isPhoto($newpath)) return; - OC_Log::write(self::$APP_TAG, 'Moving photo from '.$oldpath.' to '.$newpath, OC_Log::DEBUG); + OCP\Util::writeLog(self::$APP_TAG, 'Moving photo from '.$oldpath.' to '.$newpath, OC_Log::DEBUG); $album; $newAlbumId; $oldAlbumId; diff --git a/apps/media/lib_scanner.php b/apps/media/lib_scanner.php index 78c6ad491d..5d652c1b39 100644 --- a/apps/media/lib_scanner.php +++ b/apps/media/lib_scanner.php @@ -72,23 +72,23 @@ class OC_MEDIA_SCANNER{ $data=@self::$getID3->analyze($file); getid3_lib::CopyTagsToComments($data); if(!isset($data['comments'])){ - OC_Log::write('media',"error reading id3 tags in '$file'",OC_Log::WARN); + OCP\Util::writeLog('media',"error reading id3 tags in '$file'",OC_Log::WARN); return; } if(!isset($data['comments']['artist'])){ - OC_Log::write('media',"error reading artist tag in '$file'",OC_Log::WARN); + OCP\Util::writeLog('media',"error reading artist tag in '$file'",OC_Log::WARN); $artist='unknown'; }else{ $artist=stripslashes($data['comments']['artist'][0]); } if(!isset($data['comments']['album'])){ - OC_Log::write('media',"error reading album tag in '$file'",OC_Log::WARN); + OCP\Util::writeLog('media',"error reading album tag in '$file'",OC_Log::WARN); $album='unknown'; }else{ $album=stripslashes($data['comments']['album'][0]); } if(!isset($data['comments']['title'])){ - OC_Log::write('media',"error reading title tag in '$file'",OC_Log::WARN); + OCP\Util::writeLog('media',"error reading title tag in '$file'",OC_Log::WARN); $title='unknown'; }else{ $title=stripslashes($data['comments']['title'][0]); diff --git a/apps/media/server/xml.server.php b/apps/media/server/xml.server.php index 5297838301..1ef48d551b 100644 --- a/apps/media/server/xml.server.php +++ b/apps/media/server/xml.server.php @@ -37,7 +37,7 @@ foreach($arguments as &$argument){ } @ob_clean(); if(isset($arguments['action'])){ - OC_Log::write('media','ampache '.$arguments['action'].' request', OC_Log::DEBUG); + OCP\Util::writeLog('media','ampache '.$arguments['action'].' request', OC_Log::DEBUG); switch($arguments['action']){ case 'songs': OC_MEDIA_AMPACHE::songs($arguments); diff --git a/apps/user_migrate/admin.php b/apps/user_migrate/admin.php index 0160753af2..643d58867e 100644 --- a/apps/user_migrate/admin.php +++ b/apps/user_migrate/admin.php @@ -37,7 +37,7 @@ if (isset($_POST['user_import'])) { $to = get_temp_dir().'/'.$importname.'.zip'; if( !move_uploaded_file( $from, $to ) ){ $error = array('error'=>'Failed to move the uploaded file','hint'=>'Try checking the permissions of the '.get_temp_dir().' dir.'); - OC_Log::write( 'user_migrate', "Failed to copy the uploaded file", OC_Log::ERROR ); + OCP\Util::writeLog( 'user_migrate', "Failed to copy the uploaded file", OC_Log::ERROR ); $tmpl = new OC_Template('user_migrate', 'admin'); $tmpl->assign('error',$error); return $tmpl->fetchPage(); @@ -84,4 +84,4 @@ if (isset($_POST['user_import'])) { // fill template $tmpl = new OC_Template('user_migrate', 'admin'); return $tmpl->fetchPage(); -} \ No newline at end of file +} diff --git a/apps/user_openid/appinfo/app.php b/apps/user_openid/appinfo/app.php index cbcbe54422..730039570a 100644 --- a/apps/user_openid/appinfo/app.php +++ b/apps/user_openid/appinfo/app.php @@ -26,14 +26,14 @@ OC_User::useBackend('openid'); //check for results from openid requests if(isset($_GET['openid_mode']) and $_GET['openid_mode'] == 'id_res'){ - OC_Log::write('user_openid','openid retured',OC_Log::DEBUG); + OCP\Util::writeLog('user_openid','openid retured',OC_Log::DEBUG); $openid = new SimpleOpenID; $openid->SetIdentity($_GET['openid_identity']); $openid_validation_result = $openid->ValidateWithServer(); if ($openid_validation_result == true){ // OK HERE KEY IS VALID - OC_Log::write('user_openid','auth sucessfull',OC_Log::DEBUG); + OCP\Util::writeLog('user_openid','auth sucessfull',OC_Log::DEBUG); $identity=$openid->GetIdentity(); - OC_Log::write('user_openid','auth as '.$identity,OC_Log::DEBUG); + OCP\Util::writeLog('user_openid','auth as '.$identity,OC_Log::DEBUG); $user=OC_USER_OPENID::findUserForIdentity($identity); if($user){ $_SESSION['user_id']=$user; @@ -41,13 +41,13 @@ if(isset($_GET['openid_mode']) and $_GET['openid_mode'] == 'id_res'){ } }else if($openid->IsError() == true){ // ON THE WAY, WE GOT SOME ERROR $error = $openid->GetError(); - OC_Log::write('user_openid','ERROR CODE: '. $error['code'],OC_Log::ERROR); - OC_Log::write('user_openid','ERROR DESCRIPTION: '. $error['description'],OC_Log::ERROR); + OCP\Util::writeLog('user_openid','ERROR CODE: '. $error['code'],OC_Log::ERROR); + OCP\Util::writeLog('user_openid','ERROR DESCRIPTION: '. $error['description'],OC_Log::ERROR); }else{ // Signature Verification Failed - OC_Log::write('user_openid','INVALID AUTHORIZATION',OC_Log::ERROR); + OCP\Util::writeLog('user_openid','INVALID AUTHORIZATION',OC_Log::ERROR); } }else if (isset($_GET['openid_mode']) and $_GET['openid_mode'] == 'cancel'){ // User Canceled your Request - OC_Log::write('user_openid','USER CANCELED REQUEST',OC_Log::DEBUG); + OCP\Util::writeLog('user_openid','USER CANCELED REQUEST',OC_Log::DEBUG); return false; } diff --git a/apps/user_openid/user.php b/apps/user_openid/user.php index 8fec713aa7..edaa825baf 100644 --- a/apps/user_openid/user.php +++ b/apps/user_openid/user.php @@ -40,7 +40,7 @@ require_once '../../lib/base.php'; OC_Util::checkAppEnabled('user_openid'); if(!OC_User::userExists($USERNAME)){ - OC_Log::write('user_openid',$USERNAME.' doesn\'t exist',OC_Log::WARN); + OCP\Util::writeLog('user_openid',$USERNAME.' doesn\'t exist',OC_Log::WARN); $USERNAME=''; } $IDENTITY=OC_Helper::linkToAbsolute( "user_openid", "user.php" ).'/'.$USERNAME;