change Logging::log to Logging::info

This commit is contained in:
Martin Konecny 2012-08-21 18:41:56 -04:00
parent 15eae0698b
commit 462542bf68
19 changed files with 125 additions and 123 deletions

View file

@ -318,7 +318,7 @@ class ApiController extends Zend_Controller_Action
} }
$result['AIRTIME_API_VERSION'] = AIRTIME_API_VERSION; //used by caller to determine if the airtime they are running or widgets in use is out of date. $result['AIRTIME_API_VERSION'] = AIRTIME_API_VERSION; //used by caller to determine if the airtime they are running or widgets in use is out of date.
header("Content-type: text/javascript"); header("Content-type: text/javascript");
Logging::log($result); Logging::info($result);
// If a callback is not given, then just provide the raw JSON. // If a callback is not given, then just provide the raw JSON.
echo isset($_GET['callback']) ? $_GET['callback'].'('.json_encode($result).')' : json_encode($result); echo isset($_GET['callback']) ? $_GET['callback'].'('.json_encode($result).')' : json_encode($result);
} else { } else {
@ -359,7 +359,7 @@ class ApiController extends Zend_Controller_Action
$file->setLastPlayedTime($now); $file->setLastPlayedTime($now);
} }
} catch (Exception $e) { } catch (Exception $e) {
Logging::log($e); Logging::info($e);
} }
echo json_encode(array("status"=>1, "message"=>"")); echo json_encode(array("status"=>1, "message"=>""));
@ -475,8 +475,8 @@ class ApiController extends Zend_Controller_Action
); );
} }
Application_Model_Preference::SetImportTimestamp(); Application_Model_Preference::SetImportTimestamp();
Logging::log("--->Mode: $mode || file: {$md['MDATA_KEY_FILEPATH']} "); Logging::info("--->Mode: $mode || file: {$md['MDATA_KEY_FILEPATH']} ");
Logging::log( $md ); Logging::info( $md );
if ($mode == "create") { if ($mode == "create") {
$filepath = $md['MDATA_KEY_FILEPATH']; $filepath = $md['MDATA_KEY_FILEPATH'];
$filepath = Application_Common_OsPath::normpath($filepath); $filepath = Application_Common_OsPath::normpath($filepath);
@ -567,8 +567,8 @@ class ApiController extends Zend_Controller_Action
//unset( $info_json["MDATA_KEY_BITRATE"] ); //unset( $info_json["MDATA_KEY_BITRATE"] );
if( !array_key_exists('mode', $info_json) ) { // Log invalid requests if( !array_key_exists('mode', $info_json) ) { // Log invalid requests
Logging::log("Received bad request(key=$k), no 'mode' parameter. Bad request is:"); Logging::info("Received bad request(key=$k), no 'mode' parameter. Bad request is:");
Logging::log( $info_json ); Logging::info( $info_json );
array_push( $responses, array( array_push( $responses, array(
'error' => "Bad request. no 'mode' parameter passed.", 'error' => "Bad request. no 'mode' parameter passed.",
'key' => $k)); 'key' => $k));
@ -577,8 +577,8 @@ class ApiController extends Zend_Controller_Action
// A request still has a chance of being invalid even if it exists but it's validated // A request still has a chance of being invalid even if it exists but it's validated
// by $valid_modes array // by $valid_modes array
$mode = $info_json['mode']; $mode = $info_json['mode'];
Logging::log("Received bad request(key=$k). 'mode' parameter was invalid with value: '$mode'. Request:"); Logging::info("Received bad request(key=$k). 'mode' parameter was invalid with value: '$mode'. Request:");
Logging::log( $info_json ); Logging::info( $info_json );
array_push( $responses, array( array_push( $responses, array(
'error' => "Bad request. 'mode' parameter is invalid", 'error' => "Bad request. 'mode' parameter is invalid",
'key' => $k, 'key' => $k,
@ -615,7 +615,7 @@ class ApiController extends Zend_Controller_Action
} }
} }
Logging::log( $md ); Logging::info( $md );
// update import timestamp // update import timestamp
Application_Model_Preference::SetImportTimestamp(); Application_Model_Preference::SetImportTimestamp();
@ -781,7 +781,7 @@ class ApiController extends Zend_Controller_Action
$component = $request->getParam('component'); $component = $request->getParam('component');
$remoteAddr = Application_Model_ServiceRegister::GetRemoteIpAddr(); $remoteAddr = Application_Model_ServiceRegister::GetRemoteIpAddr();
Logging::log("Registered Component: ".$component."@".$remoteAddr); Logging::info("Registered Component: ".$component."@".$remoteAddr);
Application_Model_ServiceRegister::Register($component, $remoteAddr); Application_Model_ServiceRegister::Register($component, $remoteAddr);
} }
@ -902,7 +902,7 @@ class ApiController extends Zend_Controller_Action
public function rabbitmqDoPushAction() public function rabbitmqDoPushAction()
{ {
$request = $this->getRequest(); $request = $this->getRequest();
Logging::log("Notifying RabbitMQ to send message to pypo"); Logging::info("Notifying RabbitMQ to send message to pypo");
Application_Model_RabbitMq::PushSchedule(); Application_Model_RabbitMq::PushSchedule();
} }

View file

@ -117,7 +117,7 @@ class PlaylistController extends Zend_Controller_Action
{ {
$this->view->error = "{$p_type} not found"; $this->view->error = "{$p_type} not found";
Logging::log("{$p_type} not found"); Logging::info("{$p_type} not found");
Application_Model_Library::changePlaylist(null, $p_type); Application_Model_Library::changePlaylist(null, $p_type);
$this->createFullResponse(null); $this->createFullResponse(null);
} }
@ -133,9 +133,9 @@ class PlaylistController extends Zend_Controller_Action
{ {
$this->view->error = "Something went wrong."; $this->view->error = "Something went wrong.";
Logging::log("{$e->getFile()}"); Logging::info("{$e->getFile()}");
Logging::log("{$e->getLine()}"); Logging::info("{$e->getLine()}");
Logging::log("{$e->getMessage()}"); Logging::info("{$e->getMessage()}");
} }
private function wrongTypeToBlock($obj) private function wrongTypeToBlock($obj)
@ -176,7 +176,7 @@ class PlaylistController extends Zend_Controller_Action
$id = $this->_getParam('id', null); $id = $this->_getParam('id', null);
$type = $this->_getParam('type'); $type = $this->_getParam('type');
$objInfo = Application_Model_Library::getObjInfo($type); $objInfo = Application_Model_Library::getObjInfo($type);
Logging::log("editing {$type} {$id}"); Logging::info("editing {$type} {$id}");
if (!is_null($id)) { if (!is_null($id)) {
Application_Model_Library::changePlaylist($id, $type); Application_Model_Library::changePlaylist($id, $type);
@ -206,12 +206,12 @@ class PlaylistController extends Zend_Controller_Action
$user = new Application_Model_User($userInfo->id); $user = new Application_Model_User($userInfo->id);
try { try {
Logging::log("Currently active {$type} {$this->obj_sess->id}"); Logging::info("Currently active {$type} {$this->obj_sess->id}");
if (in_array($this->obj_sess->id, $ids)) { if (in_array($this->obj_sess->id, $ids)) {
Logging::log("Deleting currently active {$type}"); Logging::info("Deleting currently active {$type}");
Application_Model_Library::changePlaylist(null, $type); Application_Model_Library::changePlaylist(null, $type);
} else { } else {
Logging::log("Not deleting currently active {$type}"); Logging::info("Not deleting currently active {$type}");
$obj = new $objInfo['className']($this->obj_sess->id); $obj = new $objInfo['className']($this->obj_sess->id);
} }

View file

@ -69,8 +69,8 @@ class PlayouthistoryController extends Zend_Controller_Action
$startsDT = DateTime::createFromFormat("U", $starts_epoch, new DateTimeZone("UTC")); $startsDT = DateTime::createFromFormat("U", $starts_epoch, new DateTimeZone("UTC"));
$endsDT = DateTime::createFromFormat("U", $ends_epoch, new DateTimeZone("UTC")); $endsDT = DateTime::createFromFormat("U", $ends_epoch, new DateTimeZone("UTC"));
Logging::log("history starts {$startsDT->format("Y-m-d H:i:s")}"); Logging::info("history starts {$startsDT->format("Y-m-d H:i:s")}");
Logging::log("history ends {$endsDT->format("Y-m-d H:i:s")}"); Logging::info("history ends {$endsDT->format("Y-m-d H:i:s")}");
$history = new Application_Model_PlayoutHistory($startsDT, $endsDT, $params); $history = new Application_Model_PlayoutHistory($startsDT, $endsDT, $params);

View file

@ -864,9 +864,9 @@ class ScheduleController extends Zend_Controller_Action
Application_Model_RabbitMq::SendMessageToPypo("disconnect_source", $data); Application_Model_RabbitMq::SendMessageToPypo("disconnect_source", $data);
} catch (Exception $e) { } catch (Exception $e) {
$this->view->error = $e->getMessage(); $this->view->error = $e->getMessage();
Logging::log($e->getMessage()); Logging::info($e->getMessage());
Logging::log("{$e->getFile()}"); Logging::info("{$e->getFile()}");
Logging::log("{$e->getLine()}"); Logging::info("{$e->getLine()}");
} }
} }
} }

View file

@ -290,14 +290,14 @@ class ShowbuilderController extends Zend_Controller_Action
$scheduler->scheduleAfter($scheduledItems, $mediaItems); $scheduler->scheduleAfter($scheduledItems, $mediaItems);
} catch (OutDatedScheduleException $e) { } catch (OutDatedScheduleException $e) {
$this->view->error = $e->getMessage(); $this->view->error = $e->getMessage();
Logging::log($e->getMessage()); Logging::info($e->getMessage());
Logging::log("{$e->getFile()}"); Logging::info("{$e->getFile()}");
Logging::log("{$e->getLine()}"); Logging::info("{$e->getLine()}");
} catch (Exception $e) { } catch (Exception $e) {
$this->view->error = $e->getMessage(); $this->view->error = $e->getMessage();
Logging::log($e->getMessage()); Logging::info($e->getMessage());
Logging::log("{$e->getFile()}"); Logging::info("{$e->getFile()}");
Logging::log("{$e->getLine()}"); Logging::info("{$e->getLine()}");
} }
} }
@ -311,14 +311,14 @@ class ShowbuilderController extends Zend_Controller_Action
$scheduler->removeItems($items); $scheduler->removeItems($items);
} catch (OutDatedScheduleException $e) { } catch (OutDatedScheduleException $e) {
$this->view->error = $e->getMessage(); $this->view->error = $e->getMessage();
Logging::log($e->getMessage()); Logging::info($e->getMessage());
Logging::log("{$e->getFile()}"); Logging::info("{$e->getFile()}");
Logging::log("{$e->getLine()}"); Logging::info("{$e->getLine()}");
} catch (Exception $e) { } catch (Exception $e) {
$this->view->error = $e->getMessage(); $this->view->error = $e->getMessage();
Logging::log($e->getMessage()); Logging::info($e->getMessage());
Logging::log("{$e->getFile()}"); Logging::info("{$e->getFile()}");
Logging::log("{$e->getLine()}"); Logging::info("{$e->getLine()}");
} }
} }
@ -333,14 +333,14 @@ class ShowbuilderController extends Zend_Controller_Action
$scheduler->moveItem($selectedItems, $afterItem); $scheduler->moveItem($selectedItems, $afterItem);
} catch (OutDatedScheduleException $e) { } catch (OutDatedScheduleException $e) {
$this->view->error = $e->getMessage(); $this->view->error = $e->getMessage();
Logging::log($e->getMessage()); Logging::info($e->getMessage());
Logging::log("{$e->getFile()}"); Logging::info("{$e->getFile()}");
Logging::log("{$e->getLine()}"); Logging::info("{$e->getLine()}");
} catch (Exception $e) { } catch (Exception $e) {
$this->view->error = $e->getMessage(); $this->view->error = $e->getMessage();
Logging::log($e->getMessage()); Logging::info($e->getMessage());
Logging::log("{$e->getFile()}"); Logging::info("{$e->getFile()}");
Logging::log("{$e->getLine()}"); Logging::info("{$e->getLine()}");
} }
} }

View file

@ -5,7 +5,7 @@ class Logging {
private static $_logger; private static $_logger;
private static $_path; private static $_path;
public static function getLogger() private static function getLogger()
{ {
if (!isset(self::$_logger)) { if (!isset(self::$_logger)) {
$writer = new Zend_Log_Writer_Stream(self::$_path); $writer = new Zend_Log_Writer_Stream(self::$_path);
@ -37,7 +37,7 @@ class Logging {
} }
} }
public static function log($p_msg) public static function info($p_msg)
{ {
$bt = debug_backtrace(); $bt = debug_backtrace();

View file

@ -188,7 +188,7 @@ class Application_Model_Block implements Application_Model_LibraryEditable
*/ */
public function getContents($filterFiles=false) public function getContents($filterFiles=false)
{ {
Logging::log("Getting contents for block {$this->id}"); Logging::info("Getting contents for block {$this->id}");
$files = array(); $files = array();
$sql = <<<"EOT" $sql = <<<"EOT"
@ -387,11 +387,11 @@ EOT;
try { try {
if (is_numeric($p_afterItem)) { if (is_numeric($p_afterItem)) {
Logging::log("Finding block content item {$p_afterItem}"); Logging::info("Finding block content item {$p_afterItem}");
$afterItem = CcBlockcontentsQuery::create()->findPK($p_afterItem); $afterItem = CcBlockcontentsQuery::create()->findPK($p_afterItem);
$index = $afterItem->getDbPosition(); $index = $afterItem->getDbPosition();
Logging::log("index is {$index}"); Logging::info("index is {$index}");
$pos = ($addType == 'after') ? $index + 1 : $index; $pos = ($addType == 'after') ? $index + 1 : $index;
$contentsToUpdate = CcBlockcontentsQuery::create() $contentsToUpdate = CcBlockcontentsQuery::create()
@ -400,8 +400,8 @@ EOT;
->orderByDbPosition() ->orderByDbPosition()
->find($this->con); ->find($this->con);
Logging::log("Adding to block"); Logging::info("Adding to block");
Logging::log("at position {$pos}"); Logging::info("at position {$pos}");
} else { } else {
//add to the end of the block //add to the end of the block
@ -424,12 +424,12 @@ EOT;
->orderByDbPosition() ->orderByDbPosition()
->find($this->con); ->find($this->con);
Logging::log("Adding to block"); Logging::info("Adding to block");
Logging::log("at position {$pos}"); Logging::info("at position {$pos}");
} }
foreach ($p_items as $ac) { foreach ($p_items as $ac) {
Logging::log("Adding audio file {$ac}"); Logging::info("Adding audio file {$ac}");
if (is_array($ac) && $ac[1] == 'audioclip') { if (is_array($ac) && $ac[1] == 'audioclip') {
$res = $this->insertBlockElement($this->buildEntry($ac[0], $pos)); $res = $this->insertBlockElement($this->buildEntry($ac[0], $pos));
@ -485,32 +485,32 @@ EOT;
$pos = 0; $pos = 0;
//moving items to beginning of the block. //moving items to beginning of the block.
if (is_null($p_afterItem)) { if (is_null($p_afterItem)) {
Logging::log("moving items to beginning of block"); Logging::info("moving items to beginning of block");
foreach ($contentsToMove as $item) { foreach ($contentsToMove as $item) {
Logging::log("item {$item->getDbId()} to pos {$pos}"); Logging::info("item {$item->getDbId()} to pos {$pos}");
$item->setDbPosition($pos); $item->setDbPosition($pos);
$item->save($this->con); $item->save($this->con);
$pos = $pos + 1; $pos = $pos + 1;
} }
foreach ($otherContent as $item) { foreach ($otherContent as $item) {
Logging::log("item {$item->getDbId()} to pos {$pos}"); Logging::info("item {$item->getDbId()} to pos {$pos}");
$item->setDbPosition($pos); $item->setDbPosition($pos);
$item->save($this->con); $item->save($this->con);
$pos = $pos + 1; $pos = $pos + 1;
} }
} else { } else {
Logging::log("moving items after {$p_afterItem}"); Logging::info("moving items after {$p_afterItem}");
foreach ($otherContent as $item) { foreach ($otherContent as $item) {
Logging::log("item {$item->getDbId()} to pos {$pos}"); Logging::info("item {$item->getDbId()} to pos {$pos}");
$item->setDbPosition($pos); $item->setDbPosition($pos);
$item->save($this->con); $item->save($this->con);
$pos = $pos + 1; $pos = $pos + 1;
if ($item->getDbId() == $p_afterItem) { if ($item->getDbId() == $p_afterItem) {
foreach ($contentsToMove as $move) { foreach ($contentsToMove as $move) {
Logging::log("item {$move->getDbId()} to pos {$pos}"); Logging::info("item {$move->getDbId()} to pos {$pos}");
$move->setDbPosition($pos); $move->setDbPosition($pos);
$move->save($this->con); $move->save($this->con);
$pos = $pos + 1; $pos = $pos + 1;
@ -570,7 +570,7 @@ EOT;
public function getFadeInfo($pos) public function getFadeInfo($pos)
{ {
Logging::log("Getting fade info for pos {$pos}"); Logging::info("Getting fade info for pos {$pos}");
$row = CcBlockcontentsQuery::create() $row = CcBlockcontentsQuery::create()
->joinWith(CcFilesPeer::OM_CLASS) ->joinWith(CcFilesPeer::OM_CLASS)
@ -655,7 +655,7 @@ EOT;
public function setfades($fadein, $fadeout) public function setfades($fadein, $fadeout)
{ {
if (isset($fadein)) { if (isset($fadein)) {
Logging::log("Setting block fade in {$fadein}"); Logging::info("Setting block fade in {$fadein}");
$row = CcBlockcontentsQuery::create() $row = CcBlockcontentsQuery::create()
->filterByDbBlockId($this->id) ->filterByDbBlockId($this->id)
->filterByDbPosition(0) ->filterByDbPosition(0)
@ -665,7 +665,7 @@ EOT;
} }
if (isset($fadeout)) { if (isset($fadeout)) {
Logging::log("Setting block fade out {$fadeout}"); Logging::info("Setting block fade out {$fadeout}");
$row = CcBlockcontentsQuery::create() $row = CcBlockcontentsQuery::create()
->filterByDbBlockId($this->id) ->filterByDbBlockId($this->id)
->filterByDbPosition($this->getSize()-1) ->filterByDbPosition($this->getSize()-1)
@ -992,7 +992,7 @@ EOT;
public function storeCriteriaIntoDb($p_criteriaData){ public function storeCriteriaIntoDb($p_criteriaData){
// delete criteria under $p_blockId // delete criteria under $p_blockId
CcBlockcriteriaQuery::create()->findByDbBlockId($this->id)->delete(); CcBlockcriteriaQuery::create()->findByDbBlockId($this->id)->delete();
Logging::log($p_criteriaData); Logging::info($p_criteriaData);
//insert modifier rows //insert modifier rows
if (isset($p_criteriaData['criteria'])) { if (isset($p_criteriaData['criteria'])) {
$critKeys = array_keys($p_criteriaData['criteria']); $critKeys = array_keys($p_criteriaData['criteria']);
@ -1188,7 +1188,7 @@ EOT;
$qry->add($spCriteria, $spCriteriaValue, $spCriteriaModifier); $qry->add($spCriteria, $spCriteriaValue, $spCriteriaModifier);
} }
}catch (Exception $e){ }catch (Exception $e){
Logging::log($e); Logging::info($e);
} }
$i++; $i++;
} }
@ -1210,7 +1210,7 @@ EOT;
$out = $qry->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)->find(); $out = $qry->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)->find();
return array("files"=>$out, "limit"=>$limits, "count"=>$out->count()); return array("files"=>$out, "limit"=>$limits, "count"=>$out->count());
}catch(Exception $e){ }catch(Exception $e){
Logging::log($e); Logging::info($e);
} }
} }

View file

@ -21,7 +21,7 @@ class Application_Model_Library
public static function changePlaylist($p_id, $p_type) public static function changePlaylist($p_id, $p_type)
{ {
$obj_sess = new Zend_Session_Namespace(UI_PLAYLISTCONTROLLER_OBJ_SESSNAME); $obj_sess = new Zend_Session_Namespace(UI_PLAYLISTCONTROLLER_OBJ_SESSNAME);
Logging::log($obj_sess); Logging::info($obj_sess);
if (is_null($p_id) || is_null($p_type)) { if (is_null($p_id) || is_null($p_type)) {
unset($obj_sess->id); unset($obj_sess->id);

View file

@ -5,4 +5,6 @@ interface Application_Model_LibraryEditable
public function setMetadata($key, $val); public function setMetadata($key, $val);
public function setName($name); public function setName($name);
public function getLength();
public function getId();
} }

View file

@ -96,7 +96,7 @@ class Application_Model_LiveLog
return $minutes; return $minutes;
} catch (Exception $e) { } catch (Exception $e) {
header('HTTP/1.0 503 Service Unavailable'); header('HTTP/1.0 503 Service Unavailable');
Logging::log("GetLiveShowDuration - Could not connect to database."); Logging::info("GetLiveShowDuration - Could not connect to database.");
exit; exit;
} }
} }
@ -254,7 +254,7 @@ class Application_Model_LiveLog
return $minutes; return $minutes;
} catch (Exception $e) { } catch (Exception $e) {
header('HTTP/1.0 503 Service Unavailable'); header('HTTP/1.0 503 Service Unavailable');
Logging::log("GetScheduledDuration - Could not connect to database."); Logging::info("GetScheduledDuration - Could not connect to database.");
exit; exit;
} }
} }
@ -301,7 +301,7 @@ class Application_Model_LiveLog
} catch (Exception $e) { } catch (Exception $e) {
header('HTTP/1.0 503 Service Unavailable'); header('HTTP/1.0 503 Service Unavailable');
Logging::log("SetNewLogTime - Could not connect to database."); Logging::info("SetNewLogTime - Could not connect to database.");
exit; exit;
} }
} }
@ -338,7 +338,7 @@ class Application_Model_LiveLog
} catch (Exception $e) { } catch (Exception $e) {
header('HTTP/1.0 503 Service Unavailable'); header('HTTP/1.0 503 Service Unavailable');
Logging::log("SetEndTime - Could not connect to database."); Logging::info("SetEndTime - Could not connect to database.");
exit; exit;
} }
} }

View file

@ -135,8 +135,8 @@ class Application_Model_Playlist implements Application_Model_LibraryEditable
public function getLastModified($format = null) public function getLastModified($format = null)
{ {
//Logging::log($this->pl->getDbMtime($format)); //Logging::info($this->pl->getDbMtime($format));
//Logging::log($this->pl); //Logging::info($this->pl);
return $this->pl->getDbMtime($format); return $this->pl->getDbMtime($format);
} }
@ -153,7 +153,7 @@ class Application_Model_Playlist implements Application_Model_LibraryEditable
*/ */
public function getContents($filterFiles=false) public function getContents($filterFiles=false)
{ {
Logging::log("Getting contents for playlist {$this->id}"); Logging::info("Getting contents for playlist {$this->id}");
$files = array(); $files = array();
$sql = <<<SQL $sql = <<<SQL
@ -391,11 +391,11 @@ SQL;
try { try {
if (is_numeric($p_afterItem)) { if (is_numeric($p_afterItem)) {
Logging::log("Finding playlist content item {$p_afterItem}"); Logging::info("Finding playlist content item {$p_afterItem}");
$afterItem = CcPlaylistcontentsQuery::create()->findPK($p_afterItem); $afterItem = CcPlaylistcontentsQuery::create()->findPK($p_afterItem);
$index = $afterItem->getDbPosition(); $index = $afterItem->getDbPosition();
Logging::log("index is {$index}"); Logging::info("index is {$index}");
$pos = ($addType == 'after') ? $index + 1 : $index; $pos = ($addType == 'after') ? $index + 1 : $index;
$contentsToUpdate = CcPlaylistcontentsQuery::create() $contentsToUpdate = CcPlaylistcontentsQuery::create()
@ -428,13 +428,13 @@ SQL;
} }
Logging::log("Adding to playlist"); Logging::info("Adding to playlist");
Logging::log("at position {$pos}"); Logging::info("at position {$pos}");
foreach ($p_items as $ac) { foreach ($p_items as $ac) {
$res = $this->insertPlaylistElement($this->buildEntry($ac, $pos)); $res = $this->insertPlaylistElement($this->buildEntry($ac, $pos));
$pos = $pos + 1; $pos = $pos + 1;
Logging::log("Adding $ac[1] $ac[0]"); Logging::info("Adding $ac[1] $ac[0]");
} }
@ -483,32 +483,32 @@ SQL;
$pos = 0; $pos = 0;
//moving items to beginning of the playlist. //moving items to beginning of the playlist.
if (is_null($p_afterItem)) { if (is_null($p_afterItem)) {
Logging::log("moving items to beginning of playlist"); Logging::info("moving items to beginning of playlist");
foreach ($contentsToMove as $item) { foreach ($contentsToMove as $item) {
Logging::log("item {$item->getDbId()} to pos {$pos}"); Logging::info("item {$item->getDbId()} to pos {$pos}");
$item->setDbPosition($pos); $item->setDbPosition($pos);
$item->save($this->con); $item->save($this->con);
$pos = $pos + 1; $pos = $pos + 1;
} }
foreach ($otherContent as $item) { foreach ($otherContent as $item) {
Logging::log("item {$item->getDbId()} to pos {$pos}"); Logging::info("item {$item->getDbId()} to pos {$pos}");
$item->setDbPosition($pos); $item->setDbPosition($pos);
$item->save($this->con); $item->save($this->con);
$pos = $pos + 1; $pos = $pos + 1;
} }
} else { } else {
Logging::log("moving items after {$p_afterItem}"); Logging::info("moving items after {$p_afterItem}");
foreach ($otherContent as $item) { foreach ($otherContent as $item) {
Logging::log("item {$item->getDbId()} to pos {$pos}"); Logging::info("item {$item->getDbId()} to pos {$pos}");
$item->setDbPosition($pos); $item->setDbPosition($pos);
$item->save($this->con); $item->save($this->con);
$pos = $pos + 1; $pos = $pos + 1;
if ($item->getDbId() == $p_afterItem) { if ($item->getDbId() == $p_afterItem) {
foreach ($contentsToMove as $move) { foreach ($contentsToMove as $move) {
Logging::log("item {$move->getDbId()} to pos {$pos}"); Logging::info("item {$move->getDbId()} to pos {$pos}");
$move->setDbPosition($pos); $move->setDbPosition($pos);
$move->save($this->con); $move->save($this->con);
$pos = $pos + 1; $pos = $pos + 1;
@ -568,7 +568,7 @@ SQL;
public function getFadeInfo($pos) public function getFadeInfo($pos)
{ {
Logging::log("Getting fade info for pos {$pos}"); Logging::info("Getting fade info for pos {$pos}");
$row = CcPlaylistcontentsQuery::create() $row = CcPlaylistcontentsQuery::create()
->joinWith(CcFilesPeer::OM_CLASS) ->joinWith(CcFilesPeer::OM_CLASS)
@ -654,7 +654,7 @@ SQL;
public function setfades($fadein, $fadeout) public function setfades($fadein, $fadeout)
{ {
if (isset($fadein)) { if (isset($fadein)) {
Logging::log("Setting playlist fade in {$fadein}"); Logging::info("Setting playlist fade in {$fadein}");
$row = CcPlaylistcontentsQuery::create() $row = CcPlaylistcontentsQuery::create()
->filterByDbPlaylistId($this->id) ->filterByDbPlaylistId($this->id)
->filterByDbPosition(0) ->filterByDbPosition(0)
@ -664,7 +664,7 @@ SQL;
} }
if (isset($fadeout)) { if (isset($fadeout)) {
Logging::log("Setting playlist fade out {$fadeout}"); Logging::info("Setting playlist fade out {$fadeout}");
$row = CcPlaylistcontentsQuery::create() $row = CcPlaylistcontentsQuery::create()
->filterByDbPlaylistId($this->id) ->filterByDbPlaylistId($this->id)
->filterByDbPosition($this->getSize()-1) ->filterByDbPosition($this->getSize()-1)

View file

@ -66,7 +66,7 @@ class Application_Model_Preference
} catch (Exception $e) { } catch (Exception $e) {
header('HTTP/1.0 503 Service Unavailable'); header('HTTP/1.0 503 Service Unavailable');
Logging::log("Could not connect to database: ".$e->getMessage()); Logging::info("Could not connect to database: ".$e->getMessage());
exit; exit;
} }
@ -107,7 +107,7 @@ class Application_Model_Preference
} }
} catch (Exception $e) { } catch (Exception $e) {
header('HTTP/1.0 503 Service Unavailable'); header('HTTP/1.0 503 Service Unavailable');
Logging::log("Could not connect to database: ".$e->getMessage()); Logging::info("Could not connect to database: ".$e->getMessage());
exit; exit;
} }
} }

View file

@ -32,7 +32,7 @@ class Application_Model_Schedule
{ {
if (!is_int($p_prev) || !is_int($p_next)) { if (!is_int($p_prev) || !is_int($p_next)) {
//must enter integers to specify ranges //must enter integers to specify ranges
Logging::log("Invalid range parameters: $p_prev or $p_next"); Logging::info("Invalid range parameters: $p_prev or $p_next");
return array(); return array();
} }

View file

@ -110,7 +110,7 @@ class Application_Model_Scheduler
$ts = intval($instanceInfo[$id]); $ts = intval($instanceInfo[$id]);
$lastSchedTs = intval($instance->getDbLastScheduled("U")) ? : 0; $lastSchedTs = intval($instance->getDbLastScheduled("U")) ? : 0;
if ($ts < $lastSchedTs) { if ($ts < $lastSchedTs) {
Logging::log("ts {$ts} last sched {$lastSchedTs}"); Logging::info("ts {$ts} last sched {$lastSchedTs}");
throw new OutDatedScheduleException("The show {$show->getDbName()} has been previously updated!"); throw new OutDatedScheduleException("The show {$show->getDbName()} has been previously updated!");
} }
} }
@ -317,7 +317,7 @@ class Application_Model_Scheduler
*/ */
private function removeGaps($showInstance, $exclude=null) private function removeGaps($showInstance, $exclude=null)
{ {
Logging::log("removing gaps from show instance #".$showInstance); Logging::info("removing gaps from show instance #".$showInstance);
$instance = CcShowInstancesQuery::create()->findPK($showInstance, $this->con); $instance = CcShowInstancesQuery::create()->findPK($showInstance, $this->con);
if (is_null($instance)) { if (is_null($instance)) {
@ -416,7 +416,7 @@ class Application_Model_Scheduler
} else { } else {
$sched = new CcSchedule(); $sched = new CcSchedule();
} }
Logging::log($file); Logging::info($file);
$sched->setDbStarts($nextStartDT) $sched->setDbStarts($nextStartDT)
->setDbEnds($endTimeDT) ->setDbEnds($endTimeDT)
->setDbCueIn($file['cuein']) ->setDbCueIn($file['cuein'])

View file

@ -216,8 +216,8 @@ class Application_Model_Show
$con->commit(); $con->commit();
} catch (Exception $e) { } catch (Exception $e) {
$con->rollback(); $con->rollback();
Logging::log("Couldn't update schedule status."); Logging::info("Couldn't update schedule status.");
Logging::log($e->getMessage()); Logging::info($e->getMessage());
} }
Application_Model_RabbitMq::PushSchedule(); Application_Model_RabbitMq::PushSchedule();
@ -277,27 +277,27 @@ class Application_Model_Show
->filterByDbShowId($this->getId()) ->filterByDbShowId($this->getId())
->find(); ->find();
Logging::log("Unchecked days:"); Logging::info("Unchecked days:");
foreach ($p_uncheckedDays as $day) { foreach ($p_uncheckedDays as $day) {
Logging::log($day); Logging::info($day);
} }
foreach ($showDays as $showDay) { foreach ($showDays as $showDay) {
//Logging::log("Local show day is: {$showDay->getDbDay()}"); //Logging::info("Local show day is: {$showDay->getDbDay()}");
//Logging::log("First show day is: {$showDay->getDbFirstShow()}"); //Logging::info("First show day is: {$showDay->getDbFirstShow()}");
//Logging::log("Id show days is: {$showDay->getDbId()}"); //Logging::info("Id show days is: {$showDay->getDbId()}");
if (in_array($showDay->getDbDay(), $p_uncheckedDays)) { if (in_array($showDay->getDbDay(), $p_uncheckedDays)) {
$showDay->reload(); $showDay->reload();
//Logging::log("Local show day is: {$showDay->getDbDay()}"); //Logging::info("Local show day is: {$showDay->getDbDay()}");
//Logging::log("First show day is: {$showDay->getDbFirstShow()}"); //Logging::info("First show day is: {$showDay->getDbFirstShow()}");
//Logging::log("Id show days is: {$showDay->getDbId()}"); //Logging::info("Id show days is: {$showDay->getDbId()}");
$startDay = new DateTime("{$showDay->getDbFirstShow()} {$showDay->getDbStartTime()}", new DateTimeZone($showDay->getDbTimezone())); $startDay = new DateTime("{$showDay->getDbFirstShow()} {$showDay->getDbStartTime()}", new DateTimeZone($showDay->getDbTimezone()));
//Logging::log("Show start day: {$startDay->format('Y-m-d H:i:s')}"); //Logging::info("Show start day: {$startDay->format('Y-m-d H:i:s')}");
$startDay->setTimezone(new DateTimeZone("UTC")); $startDay->setTimezone(new DateTimeZone("UTC"));
//Logging::log("Show start day UTC: {$startDay->format('Y-m-d H:i:s')}"); //Logging::info("Show start day UTC: {$startDay->format('Y-m-d H:i:s')}");
$daysRemovedUTC[] = $startDay->format('w'); $daysRemovedUTC[] = $startDay->format('w');
//Logging::log("UTC show day is: {$startDay->format('w')}"); //Logging::info("UTC show day is: {$startDay->format('w')}");
} }
} }
@ -368,7 +368,7 @@ class Application_Model_Show
."WHERE instance_id = (SELECT id FROM cc_show_instances WHERE show_id = $showId ORDER BY starts LIMIT 1) AND rebroadcast = 1 " ."WHERE instance_id = (SELECT id FROM cc_show_instances WHERE show_id = $showId ORDER BY starts LIMIT 1) AND rebroadcast = 1 "
."ORDER BY starts"; ."ORDER BY starts";
//Logging::log($sql); //Logging::info($sql);
$rebroadcasts = $con->query($sql)->fetchAll(); $rebroadcasts = $con->query($sql)->fetchAll();
@ -1160,8 +1160,8 @@ class Application_Model_Show
$con->commit(); $con->commit();
} catch (Exception $e) { } catch (Exception $e) {
$con->rollback(); $con->rollback();
Logging::log("Couldn't update schedule status."); Logging::info("Couldn't update schedule status.");
Logging::log($e->getMessage()); Logging::info($e->getMessage());
} }
} }
@ -1590,7 +1590,7 @@ class Application_Model_Show
WHERE last_show IS NULL WHERE last_show IS NULL
OR first_show < '{$endTimeString}' AND last_show > '{$startTimeString}'"; OR first_show < '{$endTimeString}' AND last_show > '{$startTimeString}'";
//Logging::log($sql); //Logging::info($sql);
$res = $con->query($sql)->fetchAll(); $res = $con->query($sql)->fetchAll();
foreach ($res as $row) { foreach ($res as $row) {
Application_Model_Show::populateShow($row, $p_endTimestamp); Application_Model_Show::populateShow($row, $p_endTimestamp);
@ -1723,7 +1723,7 @@ class Application_Model_Show
$showDay->setDbFirstShow($dt)->setDbStartTime($dt) $showDay->setDbFirstShow($dt)->setDbStartTime($dt)
->save(); ->save();
//Logging::log("setting show's first show."); //Logging::info("setting show's first show.");
} }
/* Takes in a UTC DateTime object /* Takes in a UTC DateTime object

View file

@ -571,9 +571,9 @@ class Application_Model_ShowInstance
$rebroad = new Application_Model_ShowInstance($rebroadcast->getDbId()); $rebroad = new Application_Model_ShowInstance($rebroadcast->getDbId());
$rebroad->addFileToShow($file_id, false); $rebroad->addFileToShow($file_id, false);
} catch (Exception $e) { } catch (Exception $e) {
Logging::log("{$e->getFile()}"); Logging::info("{$e->getFile()}");
Logging::log("{$e->getLine()}"); Logging::info("{$e->getLine()}");
Logging::log("{$e->getMessage()}"); Logging::info("{$e->getMessage()}");
} }
} }
} }

View file

@ -96,7 +96,7 @@ class Application_Model_StoredFile
*/ */
public function setMetadata($p_md=null) public function setMetadata($p_md=null)
{ {
Logging::log("entered setMetadata"); Logging::info("entered setMetadata");
if (is_null($p_md)) { if (is_null($p_md)) {
$this->setDbColMetadata(); $this->setDbColMetadata();
} else { } else {
@ -153,7 +153,7 @@ class Application_Model_StoredFile
if (isset($this->_dbMD[$dbColumn])) { if (isset($this->_dbMD[$dbColumn])) {
$propelColumn = $this->_dbMD[$dbColumn]; $propelColumn = $this->_dbMD[$dbColumn];
$method = "set$propelColumn"; $method = "set$propelColumn";
Logging::log($method); Logging::info($method);
$this->_file->$method($mdValue); $this->_file->$method($mdValue);
} }
} }
@ -446,7 +446,7 @@ class Application_Model_StoredFile
*/ */
public function getRelativeFileUrl($baseUrl) public function getRelativeFileUrl($baseUrl)
{ {
Logging::log("getting media!"); Logging::info("getting media!");
return $baseUrl."/api/get-media/file/".$this->getId().".".$this->getFileExtension(); return $baseUrl."/api/get-media/file/".$this->getId().".".$this->getFileExtension();
} }
@ -760,7 +760,7 @@ class Application_Model_StoredFile
$chunk = isset($_REQUEST["chunk"]) ? $_REQUEST["chunk"] : 0; $chunk = isset($_REQUEST["chunk"]) ? $_REQUEST["chunk"] : 0;
$chunks = isset($_REQUEST["chunks"]) ? $_REQUEST["chunks"] : 0; $chunks = isset($_REQUEST["chunks"]) ? $_REQUEST["chunks"] : 0;
$fileName = isset($_REQUEST["name"]) ? $_REQUEST["name"] : ''; $fileName = isset($_REQUEST["name"]) ? $_REQUEST["name"] : '';
Logging::log(__FILE__.":uploadFile(): filename=$fileName to $p_targetDir"); Logging::info(__FILE__.":uploadFile(): filename=$fileName to $p_targetDir");
// Clean the fileName for security reasons // Clean the fileName for security reasons
//this needs fixing for songs not in ascii. //this needs fixing for songs not in ascii.
//$fileName = preg_replace('/[^\w\._]+/', '', $fileName); //$fileName = preg_replace('/[^\w\._]+/', '', $fileName);
@ -852,7 +852,7 @@ class Application_Model_StoredFile
public static function copyFileToStor($p_targetDir, $fileName, $tempname) public static function copyFileToStor($p_targetDir, $fileName, $tempname)
{ {
$audio_file = $p_targetDir . DIRECTORY_SEPARATOR . $tempname; $audio_file = $p_targetDir . DIRECTORY_SEPARATOR . $tempname;
Logging::log('copyFileToStor: moving file '.$audio_file); Logging::info('copyFileToStor: moving file '.$audio_file);
$md5 = md5_file($audio_file); $md5 = md5_file($audio_file);
$duplicate = Application_Model_StoredFile::RecallByMd5($md5, true); $duplicate = Application_Model_StoredFile::RecallByMd5($md5, true);
@ -877,7 +877,7 @@ class Application_Model_StoredFile
} }
if (chmod($audio_file, 0644) === false) { if (chmod($audio_file, 0644) === false) {
Logging::log("Warning: couldn't change permissions of $audio_file to 0644"); Logging::info("Warning: couldn't change permissions of $audio_file to 0644");
} }
//check to see if there is enough space in $stor to continue. //check to see if there is enough space in $stor to continue.
@ -886,7 +886,7 @@ class Application_Model_StoredFile
if (self::liquidsoapFilePlayabilityTest($audio_file)) { if (self::liquidsoapFilePlayabilityTest($audio_file)) {
Logging::log("copyFileToStor: moving file $audio_file to $audio_stor"); Logging::info("copyFileToStor: moving file $audio_file to $audio_stor");
//Martin K.: changed to rename: Much less load + quicker since this is an atomic operation //Martin K.: changed to rename: Much less load + quicker since this is an atomic operation
if (@rename($audio_file, $audio_stor) === false) { if (@rename($audio_file, $audio_stor) === false) {
@ -1004,7 +1004,7 @@ class Application_Model_StoredFile
return count($rows); return count($rows);
} catch (Exception $e) { } catch (Exception $e) {
header('HTTP/1.0 503 Service Unavailable'); header('HTTP/1.0 503 Service Unavailable');
Logging::log("Could not connect to database."); Logging::info("Could not connect to database.");
exit; exit;
} }

View file

@ -66,7 +66,7 @@ class Application_Model_StreamSetting
$ids[] = substr($row["keyname"], 0, strpos($row["keyname"], "_")); $ids[] = substr($row["keyname"], 0, strpos($row["keyname"], "_"));
} }
//Logging::log(print_r($ids, true)); //Logging::info(print_r($ids, true));
return $ids; return $ids;
} }

View file

@ -224,7 +224,7 @@ class Application_Model_Systemstatus
$partitions[$totalSpace]->totalSpace = $totalSpace; $partitions[$totalSpace]->totalSpace = $totalSpace;
$partitions[$totalSpace]->totalFreeSpace = $totalSpace - $usedSpace; $partitions[$totalSpace]->totalFreeSpace = $totalSpace - $usedSpace;
Logging::log($partitions[$totalSpace]->totalFreeSpace); Logging::info($partitions[$totalSpace]->totalFreeSpace);
} else { } else {
/* First lets get all the watched directories. Then we can group them /* First lets get all the watched directories. Then we can group them
* into the same partitions by comparing the partition sizes. */ * into the same partitions by comparing the partition sizes. */