Remove all traces of logfile_t

The earlier log file based approach for enabling and disabling
messages has now been completely replaced with the syslog priority
based approach.

Similarly as with log files before it is now possible to enable
and disable a log priority for a particular session, even though
it apparently has not been used much.

The local test-programs of the logging has got minimal attention
only to make them compile. They should get an overhaul as they did
not work before either.
This commit is contained in:
Johan Wikman
2015-11-23 19:02:46 +02:00
parent 910ddb99fd
commit a8535f42af
15 changed files with 334 additions and 489 deletions

View File

@ -46,16 +46,6 @@ enum mxs_log_priorities
MXS_LOG_WARNING | MXS_LOG_NOTICE | MXS_LOG_INFO | MXS_LOG_DEBUG),
};
typedef enum
{
LOGFILE_ERROR = 1,
LOGFILE_FIRST = LOGFILE_ERROR,
LOGFILE_MESSAGE = 2,
LOGFILE_TRACE = 4,
LOGFILE_DEBUG = 8,
LOGFILE_LAST = LOGFILE_DEBUG
} logfile_id_t;
typedef enum
{
LOG_TARGET_DEFAULT = 0,
@ -69,16 +59,10 @@ typedef enum
typedef struct log_info
{
size_t li_sesid;
int li_enabled_logs;
int li_enabled_priorities;
} log_info_t;
#define LE LOGFILE_ERROR
#define LM LOGFILE_MESSAGE
#define LT LOGFILE_TRACE
#define LD LOGFILE_DEBUG
extern int lm_enabled_priorities_bitmask;
extern int lm_enabled_logfiles_bitmask;
extern ssize_t log_ses_count[];
extern __thread log_info_t tls_log_info;
@ -86,12 +70,10 @@ extern __thread log_info_t tls_log_info;
* Check if specified log type is enabled in general or if it is enabled
* for the current session.
*/
#define LOG_IS_ENABLED(id) (((lm_enabled_logfiles_bitmask & id) || \
(log_ses_count[id] > 0 && \
tls_log_info.li_enabled_logs & id)) ? true : false)
// TODO: Add this at a later stage.
#define MXS_LOG_PRIORITY_IS_ENABLED(priority) false
#define MXS_LOG_PRIORITY_IS_ENABLED(priority) \
(((lm_enabled_priorities_bitmask & (1 << priority)) || \
(log_ses_count[priority] > 0 && \
tls_log_info.li_enabled_priorities & (1 << priority))) ? true : false)
/**
* LOG_AUGMENT_WITH_FUNCTION Each logged line is suffixed with [function-name].