1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-11 05:17:41 +03:00

Minor log fix and style

This commit is contained in:
Carlos Martin 2010-04-21 15:04:22 +02:00 committed by Ruben S. Montero
parent 21b729dbdd
commit ba790e2337
2 changed files with 13 additions and 19 deletions

View File

@ -101,17 +101,14 @@ public:
if (rc != 0)
{
if (log != 0)
{
ostringstream oss;
const char * err_msg = mysql_error(db);
int err_num = mysql_errno(db);
ostringstream oss;
const char * err_msg = mysql_error(db);
int err_num = mysql_errno(db);
oss << "SQL command was: " << c_str;
oss << ", error " << err_num << " : " << err_msg;
oss << "SQL command was: " << c_str;
oss << ", error " << err_num << " : " << err_msg;
NebulaLog::log("ONE",Log::ERROR,oss);
}
NebulaLog::log("ONE",Log::ERROR,oss);
return -1;
}
@ -130,17 +127,14 @@ public:
if (result == NULL)
{
if (log != 0)
{
ostringstream oss;
const char * err_msg = mysql_error(db);
int err_num = mysql_errno(db);
ostringstream oss;
const char * err_msg = mysql_error(db);
int err_num = mysql_errno(db);
oss << "SQL command was: " << c_str;
oss << ", error " << err_num << " : " << err_msg;
oss << "SQL command was: " << c_str;
oss << ", error " << err_num << " : " << err_msg;
NebulaLog::log("ONE",Log::ERROR,oss);
}
NebulaLog::log("ONE",Log::ERROR,oss);
return -1;
}

View File

@ -30,7 +30,7 @@ class NebulaLog
public:
enum LogType {
FILE = 0,
FILE_TS = 1,
FILE_TS = 1,
CERR = 2
};