Changeset 201


Ignore:
Timestamp:
Jul 7, 2006 10:53:09 PM (18 years ago)
Author:
scdev
Message:

Q - increased some LOG_DEBUG messages to LOG_INFO so we can run with debugging off and still get the important ones.

Location:
trunk/lib
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/ACL.inc.php

    r199 r201  
    122122                $db->query("DROP TABLE IF EXISTS aco_tbl");
    123123                $db->query("DROP TABLE IF EXISTS axo_tbl");
    124                 $app->logMsg(sprintf('Dropping and recreating tables acl_tbl, aro_tbl, aco_tbl, axo_tbl.', null), LOG_DEBUG, __FILE__, __LINE__);
     124                $app->logMsg(sprintf('Dropping and recreating tables acl_tbl, aro_tbl, aco_tbl, axo_tbl.', null), LOG_INFO, __FILE__, __LINE__);
    125125            }
    126126           
     
    261261        ");
    262262
    263         $app->logMsg(sprintf('Added %s node %s to parent %s.', $type, $name, $parent), LOG_DEBUG, __FILE__, __LINE__);
     263        $app->logMsg(sprintf('Added %s node %s to parent %s.', $type, $name, $parent), LOG_INFO, __FILE__, __LINE__);
    264264        return mysql_insert_id($db->getDBH());
    265265    }
     
    342342        $db->query("UPDATE $tbl SET rgt = rgt - ($rgt - $lft + 1) WHERE rgt > $rgt");
    343343
    344         $app->logMsg(sprintf('Removed %s node %s along with %s children.', $type, $name, $num_deleted_nodes - 1), LOG_DEBUG, __FILE__, __LINE__);
     344        $app->logMsg(sprintf('Removed %s node %s along with %s children.', $type, $name, $num_deleted_nodes - 1), LOG_INFO, __FILE__, __LINE__);
    345345        return true;
    346346    }
     
    464464        $db->query("UPDATE $tbl SET rgt = rgt + $total_transversal_value WHERE rgt >= $new_parent_rgt AND $primary_key NOT IN ('" . join("','", $ids) . "')");
    465465
    466         $app->logMsg(sprintf('Moved %s node %s to new parent %s.', $type, $name, $new_parent), LOG_DEBUG, __FILE__, __LINE__);
     466        $app->logMsg(sprintf('Moved %s node %s to new parent %s.', $type, $name, $new_parent), LOG_INFO, __FILE__, __LINE__);
    467467        return true;
    468468    }
     
    529529       
    530530        $db->query("REPLACE INTO acl_tbl VALUES ('$aro_id', '$aco_id', '$axo_id', '$allow', NOW())");
    531         $app->logMsg(sprintf('Set %s: %s -> %s -> %s.', $allow, $aro, $aco, $axo), LOG_DEBUG, __FILE__, __LINE__);
     531        $app->logMsg(sprintf('Set %s: %s -> %s -> %s.', $allow, $aro, $aco, $axo), LOG_INFO, __FILE__, __LINE__);
    532532       
    533533        return true;
     
    647647            if (!list($access) = mysql_fetch_row($qid)) {
    648648                $this->cache->set($cache_hash, 'deny');
    649                 // $app->logMsg(sprintf('Access denyed: %s -> %s -> %s. No records found.', $aro, $aco, $axo), LOG_DEBUG, __FILE__, __LINE__);
     649                $app->logMsg(sprintf('Access denyed: %s -> %s -> %s. No records found.', $aro, $aco, $axo), LOG_DEBUG, __FILE__, __LINE__);
    650650                return false;
    651651            }
     
    654654       
    655655        if ('allow' == $access) {
    656             // $app->logMsg(sprintf('Access granted: %s -> %s -> %s.', $aro, $aco, $axo), LOG_DEBUG, __FILE__, __LINE__);
     656            $app->logMsg(sprintf('Access granted: %s -> %s -> %s.', $aro, $aco, $axo), LOG_DEBUG, __FILE__, __LINE__);
    657657            return true;
    658658        } else {
    659             // $app->logMsg(sprintf('Access denyed: %s -> %s -> %s.', $aro, $aco, $axo), LOG_DEBUG, __FILE__, __LINE__);
     659            $app->logMsg(sprintf('Access denyed: %s -> %s -> %s.', $aro, $aco, $axo), LOG_DEBUG, __FILE__, __LINE__);
    660660            return false;
    661661        }
  • trunk/lib/App.inc.php

    r189 r201  
    345345        }
    346346        $this->timer->stop('_app');
    347         $this->logMsg(sprintf('Script ended gracefully. Execution time: %s. Number of db queries: %s.', $this->timer->getTime('_app'), $num_queries), LOG_DEBUG, __FILE__, __LINE__);
     347        $this->logMsg(sprintf('Script ended gracefully. Execution time: %s. Number of db queries: %s.', $this->timer->getTime('_app'), $num_queries), LOG_INFO, __FILE__, __LINE__);
    348348    }
    349349
  • trunk/lib/Auth_SQL.inc.php

    r199 r201  
    135135            if ($recreate_db) {
    136136                $db->query("DROP TABLE IF EXISTS " . $this->getParam('db_table'));
    137                 $app->logMsg(sprintf('Dropping and recreating table %s.', $this->getParam('db_table')), LOG_DEBUG, __FILE__, __LINE__);
     137                $app->logMsg(sprintf('Dropping and recreating table %s.', $this->getParam('db_table')), LOG_INFO, __FILE__, __LINE__);
    138138            }
    139139
     
    192192                if ($recreate_db) {
    193193                    $db->query("DROP TABLE IF EXISTS " . $this->getParam('db_login_table'));
    194                     $app->logMsg(sprintf('Dropping and recreating table %s.', $this->getParam('db_login_table')), LOG_DEBUG, __FILE__, __LINE__);
     194                    $app->logMsg(sprintf('Dropping and recreating table %s.', $this->getParam('db_login_table')), LOG_INFO, __FILE__, __LINE__);
    195195                }
    196196                $db->query("CREATE TABLE IF NOT EXISTS " . $this->getParam('db_login_table') . " (
  • trunk/lib/Cache.inc.php

    r188 r201  
    5252
    5353        if (true !== $app->getParam('enable_session')) {
    54             $app->logMsg('Cache disabled, enable_session is false.', LOG_DEBUG, __FILE__, __LINE__);
     54            $app->logMsg('Cache disabled, enable_session is false.', LOG_INFO, __FILE__, __LINE__);
    5555            $this->setParam(array('enabled' => false));
    5656        }
  • trunk/lib/DBSessionHandler.inc.php

    r146 r201  
    8181            if ($recreate_db) {
    8282                $this->db->query("DROP TABLE IF EXISTS " . $this->db->escapeString($this->_params['db_table']));
    83                 $app->logMsg(sprintf('Dropping and recreating table %s.', $this->_params['db_table']), LOG_DEBUG, __FILE__, __LINE__);
     83                $app->logMsg(sprintf('Dropping and recreating table %s.', $this->_params['db_table']), LOG_INFO, __FILE__, __LINE__);
    8484            }
    8585            $this->db->query("CREATE TABLE IF NOT EXISTS " . $this->db->escapeString($this->_params['db_table']) . " (
  • trunk/lib/Email.inc.php

    r146 r201  
    294294        // Ensure message was successfully accepted for delivery.
    295295        if (mail($final_to, $this->_params['subject'], $final_body, $final_headers, $envelope_sender_header)) {
    296             $app->logMsg(sprintf('Email successfully sent to %s', $final_to), LOG_DEBUG, __FILE__, __LINE__);
     296            $app->logMsg(sprintf('Email successfully sent to %s', $final_to), LOG_INFO, __FILE__, __LINE__);
    297297            return true;
    298298        } else {
  • trunk/lib/Hierarchy.inc.php

    r141 r201  
    210210                )
    211211            ");
    212             $app->logMsg(sprintf('insertNode: Added node %s %s with parent %s %s.', $child_type, $child_id, $parent['node_type'], $parent['node_id']), LOG_DEBUG, __FILE__, __LINE__);
     212            $app->logMsg(sprintf('insertNode: Added node %s %s with parent %s %s.', $child_type, $child_id, $parent['node_type'], $parent['node_id']), LOG_INFO, __FILE__, __LINE__);
    213213        }
    214214        return true;
     
    256256            AND child_id = '" . $db->escapeString($child_id) . "'
    257257        ");
    258         $app->logMsg(sprintf('deleteNode: Deleted node %s %s.', $child_type, $child_id), LOG_DEBUG, __FILE__, __LINE__);
     258        $app->logMsg(sprintf('deleteNode: Deleted node %s %s.', $child_type, $child_id), LOG_INFO, __FILE__, __LINE__);
    259259
    260260        return true;
     
    336336            AND relationship_type " . (is_null($relationship_type) ? "IS NULL" : "= '" . $db->escapeString($relationship_type) . "'") . "
    337337        ");
    338         $app->logMsg(sprintf('moveNode: Deleted node %s %s.', $child_type, $child_id), LOG_DEBUG, __FILE__, __LINE__);
     338        $app->logMsg(sprintf('moveNode: Deleted node %s %s.', $child_type, $child_id), LOG_INFO, __FILE__, __LINE__);
    339339
    340340        // Insert new nodes with the new parents.
  • trunk/lib/ImageThumb.inc.php

    r199 r201  
    367367                $file_size = filesize($dest_file);
    368368                if (false !== $file_size && $file_size < $spec['keep_filesize']) {
    369                     $app->logMsg(sprintf('Skipping thumbnail %s. File already exists and file size is less than %s bytes.', $spec['dest_dir'] . '/' . $file_name, $spec['keep_filesize']), LOG_DEBUG, __FILE__, __LINE__);
     369                    $app->logMsg(sprintf('Skipping thumbnail %s. File already exists and file size is less than %s bytes.', $spec['dest_dir'] . '/' . $file_name, $spec['keep_filesize']), LOG_INFO, __FILE__, __LINE__);
    370370                    continue;
    371371                }
     
    376376            if ($image_size['0'] <= $spec['width'] && $image_size['1'] <= $spec['height'] && !$spec['allow_upscaling']) {
    377377                $spec['scaling_type'] = IMAGETHUMB_NO_SCALE;
    378                 $app->logMsg(sprintf('Image %s smaller than specified %s thumbnail size. Keeping original size.', $file_name, basename($spec['dest_dir'])), LOG_DEBUG, __FILE__, __LINE__);
     378                $app->logMsg(sprintf('Image %s smaller than specified %s thumbnail size. Keeping original size.', $file_name, basename($spec['dest_dir'])), LOG_INFO, __FILE__, __LINE__);
    379379            }
    380380
     
    382382            if (IMAGETHUMB_METHOD_NETPBM === $this->getParam('resize_method') && file_exists($this->getParam('anytopnm_binary')) && file_exists($this->getParam('pnmscale_binary')) && file_exists($this->getParam('cjpeg_binary'))) {
    383383                // Resize using Netpbm binaries.
    384                 // $app->logMsg(sprintf('Resizing with Netpbm: %s', $source_file), LOG_DEBUG, __FILE__, __LINE__);
     384                $app->logMsg(sprintf('Resizing with Netpbm: %s', $source_file), LOG_DEBUG, __FILE__, __LINE__);
    385385                $return_val += $this->_resizeWithNetpbm($source_file, $dest_file, $spec);
    386386            } else if (IMAGETHUMB_METHOD_GD === $this->getParam('resize_method') && extension_loaded('gd')) {
    387387                // Resize with GD.
    388                 // $app->logMsg(sprintf('Resizing with GD: %s', $source_file), LOG_DEBUG, __FILE__, __LINE__);
     388                $app->logMsg(sprintf('Resizing with GD: %s', $source_file), LOG_DEBUG, __FILE__, __LINE__);
    389389                $return_val += $this->_resizeWithGD($source_file, $dest_file, $spec);
    390390            } else {
     
    637637            }
    638638        }
    639         $app->logMsg(sprintf('THumbnails successfully deleted for file: %s', $file_name), LOG_DEBUG, __FILE__, __LINE__);
     639        $app->logMsg(sprintf('THumbnails successfully deleted for file: %s', $file_name), LOG_INFO, __FILE__, __LINE__);
    640640        return 0 === $return_val;
    641641    }
     
    658658        }
    659659
     660        // Ensure we have a source.
     661        if ('' == $file_name) {
     662            $app->logMsg(sprintf('Cannot delete, filename empty.'), LOG_WARNING, __FILE__, __LINE__);
     663            return false;
     664        }
     665
    660666        $source_file = realpath(sprintf('%s/%s', $this->getParam('source_dir'), $file_name));
    661         if (!unlink($source_file)) {
     667        if (is_file($source_file) && unlink($source_file)) {
     668            $app->logMsg(sprintf('Original file successfully deleted: %s', $file_name), LOG_INFO, __FILE__, __LINE__);
     669            return true;
     670        } else {
    662671            $app->logMsg(sprintf('Delete original failed: %s', $source_file), LOG_WARNING, __FILE__, __LINE__);
    663672            return false;
    664673        }
    665         $app->logMsg(sprintf('Original file successfully deleted: %s', $file_name), LOG_DEBUG, __FILE__, __LINE__);
    666         return true;
    667674    }
    668675
  • trunk/lib/Lock.inc.php

    r185 r201  
    8484            if ($recreate_db) {
    8585                $db->query("DROP TABLE IF EXISTS " . $this->getParam('db_table'));
    86                 $app->logMsg(sprintf('Dropping and recreating table %s.', $this->getParam('db_table')), LOG_DEBUG, __FILE__, __LINE__);
     86                $app->logMsg(sprintf('Dropping and recreating table %s.', $this->getParam('db_table')), LOG_INFO, __FILE__, __LINE__);
    8787            }
    8888            $db->query("CREATE TABLE IF NOT EXISTS " . $db->escapeString($this->getParam('db_table')) . " (
  • trunk/lib/MCVE.inc.php

    r141 r201  
    161161                mcve_text_avs(MCVE_TransactionAVS($this->conn, $tid)),
    162162                mcve_text_cv(MCVE_TransactionCV($this->conn, $tid))
    163             ), LOG_DEBUG, __FILE__, __LINE__);
     163            ), LOG_INFO, __FILE__, __LINE__);
    164164            return true;
    165165        } else {
  • trunk/lib/Prefs.inc.php

    r190 r201  
    9393            if ($recreate_db) {
    9494                $db->query("DROP TABLE IF EXISTS " . $this->getParam('db_table'));
    95                 $app->logMsg(sprintf('Dropping and recreating table %s.', $this->getParam('db_table')), LOG_DEBUG, __FILE__, __LINE__);
     95                $app->logMsg(sprintf('Dropping and recreating table %s.', $this->getParam('db_table')), LOG_INFO, __FILE__, __LINE__);
    9696            }
    9797            $db->query("CREATE TABLE IF NOT EXISTS " . $db->escapeString($this->getParam('db_table')) . " (
  • trunk/lib/Utilities.inc.php

    r191 r201  
    250250 * @version     1.1.0
    251251 */
    252 function humanFileSize($size, $max_unit=null, $format='%01.2f %s')
     252function humanFileSize($size, $format='%01.2f %s', $max_unit=null)
    253253{
    254254    // Units
     
    653653   
    654654    if ('' == trim($val)) {
    655         $app->logMsg(sprintf('Cannot add signature to an empty string.', null), LOG_DEBUG, __FILE__, __LINE__);
     655        $app->logMsg(sprintf('Cannot add signature to an empty string.', null), LOG_INFO, __FILE__, __LINE__);
    656656        return '';
    657657    }
  • trunk/lib/Version.inc.php

    r169 r201  
    9090            if ($recreate_db) {
    9191                $db->query("DROP TABLE IF EXISTS " . $this->getParam('db_table'));
    92                 $app->logMsg(sprintf('Dropping and recreating table %s.', $this->getParam('db_table')), LOG_DEBUG, __FILE__, __LINE__);
     92                $app->logMsg(sprintf('Dropping and recreating table %s.', $this->getParam('db_table')), LOG_INFO, __FILE__, __LINE__);
    9393            }
    9494            $db->query("CREATE TABLE IF NOT EXISTS " . $db->escapeString($this->getParam('db_table')) . " (
Note: See TracChangeset for help on using the changeset viewer.