port some of the log call to the new public api

more to come
This commit is contained in:
Frank Karlitschek 2012-05-01 14:29:34 +02:00
parent 8a69116e94
commit 3f9ac6405a
6 changed files with 17 additions and 17 deletions

View File

@ -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;

View File

@ -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]);

View File

@ -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);

View File

@ -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();

View File

@ -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;
}

View File

@ -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;