MXS-228: Include file name and line numbers
This change does not log the file name and line numbers, but the function name. Together with the commit information that is logged in conjunction with a crash and that MaxScale can tell, when invoked, that is enough to be able to pinpoint the location where a logging was made. Furthermore, that is a lot less intrusive and less confusing for an end-user than filename + line. This is just a temporary workaround; the logging mechanism needs to get an overhaul: - Separate severity and logging target. - Take syslog severities into use. - Simplify what needs to be done by developer. - etc.
This commit is contained in:
@ -118,11 +118,15 @@ void skygw_logmanager_exit(void);
|
||||
* free private write buffer list
|
||||
*/
|
||||
void skygw_log_done(void);
|
||||
int skygw_log_write(logfile_id_t id, const char* format, ...);
|
||||
int skygw_log_write_context(logfile_id_t id,
|
||||
const char* file, int line, const char* function,
|
||||
const char* format, ...);
|
||||
int skygw_log_flush(logfile_id_t id);
|
||||
void skygw_log_sync_all(void);
|
||||
int skygw_log_rotate(logfile_id_t id);
|
||||
int skygw_log_write_flush(logfile_id_t id, const char* format, ...);
|
||||
int skygw_log_write_context_flush(logfile_id_t id,
|
||||
const char* file, int line, const char* function,
|
||||
const char* format, ...);
|
||||
int skygw_log_enable(logfile_id_t id);
|
||||
int skygw_log_disable(logfile_id_t id);
|
||||
void skygw_log_sync_all(void);
|
||||
@ -130,6 +134,12 @@ void skygw_set_highp(int);
|
||||
void logmanager_enable_syslog(int);
|
||||
void logmanager_enable_maxscalelog(int);
|
||||
|
||||
#define skygw_log_write(id, format, ...)\
|
||||
skygw_log_write_context(id, __FILE__, __LINE__, __FUNCTION__, format, ##__VA_ARGS__)
|
||||
|
||||
#define skygw_log_write_flush(id, format, ...)\
|
||||
skygw_log_write_context_flush(id, __FILE__, __LINE__, __FUNCTION__, format, ##__VA_ARGS__)
|
||||
|
||||
EXTERN_C_BLOCK_END
|
||||
|
||||
const char* get_trace_prefix_default(void);
|
||||
|
||||
Reference in New Issue
Block a user