Changeset 6804
- Timestamp:
- 12/29/07 06:45:22 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/dwhittle/1.1/lib/debug/sfWebDebug.class.php
r6738 r6804 101 101 $logLine = preg_replace('/\b(SELECT|FROM|AS|LIMIT|ASC|COUNT|DESC|WHERE|LEFT JOIN|INNER JOIN|RIGHT JOIN|ORDER BY|GROUP BY|IN|LIKE|DISTINCT|DELETE|INSERT|INTO|VALUES)\b/', '<span class="sfWebDebugLogInfo">\\1</span>', $logLine); 102 102 103 // remove username/password from dsn104 if (stripos($logLine, 'dsn') !== false)105 {106 $logLine = preg_replace("/=>\s+'?[^'\s,]+'?/", "=> '******'", $logLine);107 }108 109 103 return $logLine; 110 104 } … … 171 165 172 166 // sql queries log 173 if (preg_match('/ execute(?:Query|Update).+?\:\s+(.+)$/', $log, $match))167 if (preg_match('/\b(SELECT|INSERT|UPDATE|DELETE)\b/', $log, $match)) 174 168 { 175 $sqlLogs[] .= $ match[1];169 $sqlLogs[] .= $log; 176 170 } 177 171 branches/dwhittle/1.1/lib/plugins/sfPropelPlugin/lib/propel/log/sfPropelLogger.class.php
r6772 r6804 117 117 public function log($message, $severity = sfLogger::DEBUG) 118 118 { 119 // get a backtrace to pass class, function, file, & line to logger120 // $trace = debug_backtrace();121 // sprintf('%s->%s on line %s in file %s', $trace[2]['class'], $trace[2]['function'], $trace[1]['file'], $trace[1]['line']);122 123 $message = stripos('SELECT', $message) ? 'executeQuery: '.$message : 'executeUpdate: '.$message;124 125 119 $this->dispatcher->notify(new sfEvent($this, 'application.log', array($message, 'priority' => $severity))); 126 120 }