Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals

log.h File Reference

#include "common.h"
#include "str.h"
#include "config.h"
#include <stdio.h>

Go to the source code of this file.


Detailed Description

libcprops logging facilities

cp_log_init(filename, level) should be called on startup with a log file name and a log level. the following macros may be used for logging messages.

before exiting, cp_log_close() should be called to ensure the log is flushed.

Definition in file log.h.


Define Documentation

#define LOG_LEVEL_DEBUG   0
 

debug level

Definition at line 32 of file log.h.

#define LOG_LEVEL_ERROR   3
 

quit - severe errors only

Definition at line 38 of file log.h.

#define LOG_LEVEL_FATAL   4
 

very quiet - report fatal errors only

Definition at line 40 of file log.h.

#define LOG_LEVEL_INFO   1
 

normal log level

Definition at line 34 of file log.h.

Referenced by cp_http_response_write().

#define LOG_LEVEL_SILENT   5
 

no logging

Definition at line 42 of file log.h.

#define LOG_LEVEL_WARNING   2
 

relatively quiet - warnings only

Definition at line 36 of file log.h.

#define PRECISE_TIME   "3"
 

precision of seconds: undefine or use 1-6

Definition at line 55 of file log.h.


Function Documentation

CPROPS_DLL void cp_dump int  log_level,
cp_string str
 

hex dump a cp_string

Definition at line 665 of file log.c.

Referenced by cp_ndump().

CPROPS_DLL void cp_error int  code,
char *  msg,
  ...
 

print out a LOG_LEVEL_ERROR log message

Definition at line 465 of file log.c.

References cp_hashtable_get().

Referenced by cp_client_connect(), cp_client_reopen(), cp_connection_descriptor_create(), cp_connection_descriptor_write(), cp_connection_descrpitor_read(), cp_db_connection_close_statement(), cp_db_connection_commit(), cp_db_connection_escape_binary(), cp_db_connection_escape_string(), cp_db_connection_execute_statement(), cp_db_connection_execute_statement_args(), cp_db_connection_pool_create(), cp_db_connection_prepare_statement(), cp_db_connection_rollback(), cp_db_connection_set_autocommit(), cp_db_connection_set_fetch_size(), cp_db_connection_set_read_result_set_at_once(), cp_db_connection_unescape_binary(), cp_http_service_create(), cp_httpclient_fetch_ctl_exec(), cp_httpclient_init(), cp_httpsocket_create(), cp_pooled_thread_run_task(), cp_result_set_get_field_types(), cp_result_set_get_headers(), cp_result_set_next(), cp_socket_create(), cp_string_create(), and cp_thread_pool_create().

CPROPS_DLL void cp_fatal int  code,
char *  msg,
  ...
 

print out a LOG_LEVEL_FATAL log message and exit. if log_level is LOG_LEVEL_SILENT, the error message is supressed but the process still exits.

Definition at line 568 of file log.c.

Referenced by cp_client_init(), cp_pooled_thread_client_interface_create(), cp_pooled_thread_scheduler_create(), and cp_thread_pool_create().

CPROPS_DLL void cp_log const char *  msg,
  ...
 

unconditionally log a message

Definition at line 242 of file log.c.

Referenced by cp_http_response_write().

CPROPS_DLL void cp_ndump int  log_level,
cp_string str,
size_t  len
 

hex dump up to len bytes of a cp_string

Definition at line 726 of file log.c.

References cp_dump().

Referenced by cp_http_response_write().

CPROPS_DLL void cp_nlog size_t  len,
const char *  msg,
  ...
 

unconditionally log a limited length message

Definition at line 257 of file log.c.

Referenced by cp_http_response_write().

CPROPS_DLL void cp_perror int  code,
int  errno_code,
char *  msg,
  ...
 

print out a LOG_LEVEL_ERROR log message with an errno code

Definition at line 509 of file log.c.

References cp_hashtable_get().

Referenced by cp_client_close(), cp_client_create(), cp_client_reopen(), cp_socket_connection_close(), and cp_socket_listen().

CPROPS_DLL void cp_warn char *  msg,
  ...
 

print out a LOG_LEVEL_WARNING log message

Definition at line 451 of file log.c.

Referenced by cp_http_service_delete().


Generated on Sat Dec 1 10:25:30 2007 for cprops by  doxygen 1.3.9.1