/** * Logs an error message through Config. * * @param what string what the caller did that went badly * @param why string why it didn't work out (optional) */ private function errorLog(Database $db, $what, $why = null) { $mess = "Database::{$what} failed: {$why}"; if ($db->isTiming()) { $lt = $db->getLastTime(); if (isset($lt)) { $mess .= ', ' . sprintf('time: %.4f seconds', $lt); } } # Usually looks something like: # Database::action(details), failed: it didn't work out, time: n.mmmm seconds $db->getSite()->log->error($mess, 4); }