diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2003-11-22 17:10:16 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2003-11-22 17:10:16 +0000 |
| commit | b7f7e69b3b6063a39c7c136d261f5e8b52db08b5 (patch) | |
| tree | c602abe883e8342eccb6ba9a82d9379c2dd3d0f7 /include | |
| parent | cb91566a31bc0782dc9369dde5fd24368b5e616b (diff) | |
Minor changes.
git-svn-id: svn://svn.zabbix.com/trunk@1059 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'include')
| -rw-r--r-- | include/db.c | 13 | ||||
| -rw-r--r-- | include/log.c | 5 | ||||
| -rw-r--r-- | include/log.h | 1 |
3 files changed, 12 insertions, 7 deletions
diff --git a/include/db.c b/include/db.c index 4b892f68..f6f2d068 100644 --- a/include/db.c +++ b/include/db.c @@ -94,10 +94,9 @@ void DBconnect(char *dbhost, char *dbname, char *dbuser, char *dbpassword, ch */ int DBexecute(char *query) { - +/* zabbix_set_log_level(LOG_LEVEL_DEBUG);*/ + zabbix_log( LOG_LEVEL_DEBUG, "Executing query:%s",query); #ifdef HAVE_MYSQL - zabbix_log( LOG_LEVEL_DEBUG, "Executing query:%s\n",query); -/* zabbix_log( LOG_LEVEL_WARNING, "Executing query:%s\n",query)*/; if( mysql_query(&mysql,query) != 0 ) { @@ -109,8 +108,6 @@ int DBexecute(char *query) #ifdef HAVE_PGSQL PGresult *result; - zabbix_log( LOG_LEVEL_DEBUG, "Executing query:%s\n",query); - result = PQexec(conn,query); if( result==NULL) @@ -129,6 +126,7 @@ int DBexecute(char *query) } PQclear(result); #endif +/* zabbix_set_log_level(LOG_LEVEL_WARNING);*/ return SUCCEED; } @@ -138,8 +136,9 @@ int DBexecute(char *query) */ DB_RESULT *DBselect(char *query) { +/* zabbix_set_log_level(LOG_LEVEL_DEBUG);*/ + zabbix_log( LOG_LEVEL_DEBUG, "Executing query:%s",query); #ifdef HAVE_MYSQL - zabbix_log( LOG_LEVEL_DEBUG, "Executing query:%s\n",query); /* zabbix_log( LOG_LEVEL_WARNING, "Executing query:%s\n",query);*/ if( mysql_query(&mysql,query) != 0 ) @@ -148,12 +147,12 @@ DB_RESULT *DBselect(char *query) zabbix_log(LOG_LEVEL_ERR, "Query failed:%s", mysql_error(&mysql) ); exit( FAIL ); } +/* zabbix_set_log_level(LOG_LEVEL_WARNING);*/ return mysql_store_result(&mysql); #endif #ifdef HAVE_PGSQL PGresult *result; - zabbix_log( LOG_LEVEL_DEBUG, "Executing query:%s\n",query); result = PQexec(conn,query); if( result==NULL) diff --git a/include/log.c b/include/log.c index c9b13e1b..e6887982 100644 --- a/include/log.c +++ b/include/log.c @@ -74,6 +74,11 @@ int zabbix_open_log(int type,int level, const char *filename) return SUCCEED; } +void zabbix_set_log_level(int level) +{ + log_level = level; +} + void zabbix_log(int level, const char *fmt, ...) { char str[MAX_STRING_LEN+1]; diff --git a/include/log.h b/include/log.h index bde12ccf..8b767bdd 100644 --- a/include/log.h +++ b/include/log.h @@ -33,5 +33,6 @@ /* Type - 0 (syslog), 1 - file */ int zabbix_open_log(int type,int level, const char *filename); void zabbix_log(int level, const char *fmt, ...); +void zabbix_set_log_level(int level); #endif |
