MIDAS
|
Classes | |
struct | msg_buffer_entry |
Functions | |
std::string | cm_get_error (INT code) |
int | cm_msg_early_init (void) |
int | cm_msg_open_buffer (void) |
int | cm_msg_close_buffer (void) |
INT EXPRT | cm_msg_facilities (STRING_LIST *list) |
void | cm_msg_get_logfile (const char *fac, time_t t, std::string *filename, std::string *linkname, std::string *linktarget) |
INT | cm_set_msg_print (INT system_mask, INT user_mask, int(*func)(const char *)) |
INT | cm_msg_log (INT message_type, const char *facility, const char *message) |
static std::string | cm_msg_format (INT message_type, const char *filename, INT line, const char *routine, const char *format, va_list *argptr) |
static INT | cm_msg_send_event (DWORD ts, INT message_type, const char *send_message) |
INT | cm_msg_flush_buffer () |
INT | cm_msg (INT message_type, const char *filename, INT line, const char *routine, const char *format,...) |
INT | cm_msg1 (INT message_type, const char *filename, INT line, const char *facility, const char *routine, const char *format,...) |
INT | cm_msg_register (EVENT_HANDLER *func) |
static void | add_message (char **messages, int *length, int *allocated, time_t tstamp, const char *new_message) |
static int | cm_msg_retrieve1 (const char *filename, time_t t, INT n_messages, char **messages, int *length, int *allocated, int *num_messages) |
INT | cm_msg_retrieve2 (const char *facility, time_t t, INT n_message, char **messages, int *num_messages) |
INT | cm_msg_retrieve (INT n_message, char *message, INT buf_size) |
Variables | |
static std::deque< msg_buffer_entry > | gMsgBuf |
static std::mutex | gMsgBufMutex |
dox dox
|
static |
std::string cm_get_error | ( | INT | code | ) |
Convert error code to string. Used after cm_connect_experiment to print error string in command line programs or windows programs.
code | Error code as defined in midas.h |
string | Error string |
Definition at line 457 of file midas.cxx.
INT cm_msg | ( | INT | message_type, |
const char * | filename, | ||
INT | line, | ||
const char * | routine, | ||
const char * | format, | ||
... | |||
) |
This routine can be called whenever an internal error occurs or an informative message is produced. Different message types can be enabled or disabled by setting the type bits via cm_set_msg_print().
message_type | (See midas_macro). |
filename | Name of source file where error occured |
line | Line number where error occured |
routine | Routine name. |
format | message to printout, ... Parameters like for printf() |
Definition at line 917 of file midas.cxx.
INT cm_msg1 | ( | INT | message_type, |
const char * | filename, | ||
INT | line, | ||
const char * | facility, | ||
const char * | routine, | ||
const char * | format, | ||
... | |||
) |
This routine is similar to cm_msg(). It differs from cm_msg() only by the logging destination being a file given through the argument list i.e:facility
message_type | See midas_macro. |
filename | Name of source file where error occured |
line | Line number where error occured |
facility | Logging file name |
routine | Routine name |
format | message to printout, ... Parameters like for printf() |
Definition at line 975 of file midas.cxx.
int cm_msg_close_buffer | ( | void | ) |
int cm_msg_early_init | ( | void | ) |
INT EXPRT cm_msg_facilities | ( | STRING_LIST * | list | ) |
Retrieve list of message facilities by searching logfiles on disk
list | List of facilities |
Definition at line 506 of file midas.cxx.
INT cm_msg_flush_buffer | ( | void | ) |
This routine can be called to process messages buffered by cm_msg(). Normally it is called from cm_yield() and cm_disconnect_experiment() to make sure all accumulated messages are processed.
Definition at line 867 of file midas.cxx.
|
static |
void cm_msg_get_logfile | ( | const char * | fac, |
time_t | t, | ||
std::string * | filename, | ||
std::string * | linkname, | ||
std::string * | linktarget | ||
) |
Definition at line 541 of file midas.cxx.
Write message to logging file. Called by cm_msg.
message_type | Message type |
message | Message string |
facility | Message facility, filename in which messages will be written |
Definition at line 666 of file midas.cxx.
int cm_msg_open_buffer | ( | void | ) |
Definition at line 476 of file midas.cxx.
INT cm_msg_register | ( | EVENT_HANDLER * | func | ) |
Register a dispatch function for receiving system messages.
func | Dispatch function. |
Definition at line 1053 of file midas.cxx.
Retrieve newest messages from "midas" facility log file
n_message | Number of messages to retrieve |
message | buf_size bytes of messages, separated by characters. The returned number of bytes is normally smaller than the initial buf_size, since only full lines are returned. |
*buf_size | Size of message buffer to fill |
Definition at line 1336 of file midas.cxx.
|
static |
Definition at line 1098 of file midas.cxx.
INT cm_msg_retrieve2 | ( | const char * | facility, |
time_t | t, | ||
INT | n_message, | ||
char ** | messages, | ||
int * | num_messages | ||
) |
Retrieve old messages from log file
facility | Logging facility ("midas", "chat", "lazy", ...) |
t | Return messages logged before and including time t, value 0 means start with newest messages |
min_messages | Minimum number of messages to return |
messages | messages, newest first, separated by characters. caller should free() this buffer at the end. |
num_messages | Number of messages returned |
Definition at line 1266 of file midas.cxx.
Definition at line 826 of file midas.cxx.
Set message masks. When a message is generated by calling cm_msg(), it can got to two destinatinons. First a user defined callback routine and second to the "SYSMSG" buffer.
A user defined callback receives all messages which satisfy the user_mask.
system_mask | Bit masks for MERROR, MINFO etc. to send system messages. |
user_mask | Bit masks for MERROR, MINFO etc. to send messages to the user callback. |
func | Function which receives all printout. By setting "puts", messages are just printed to the screen. |
Definition at line 649 of file midas.cxx.
|
static |