MilterLogger
3
milter managerライブラリ

# MilterLogger

## 概要

    #define             milter_log                          (level,
                                                             format,
                                                             ...)
    #define             milter_error                        (format,
                                                             ...)
    #define             milter_critical                     (format,
                                                             ...)
    #define             milter_message                      (format,
                                                             ...)
    #define             milter_warning                      (format,
                                                             ...)
    #define             milter_debug                        (format,
                                                             ...)
    #define             milter_info                         (format,
                                                             ...)
    #define             milter_statistics                   (format,
                                                             ...)
    enum                MilterLogLevelFlags;
    #define             MILTER_LOG_LEVEL_ALL
    enum                MilterLogItemFlags;
    #define             MILTER_LOG_ITEM_ALL
    enum                MilterLogColorize;
    struct              MilterLogger;
    GQuark              milter_logger_error_quark           (void);
    MilterLogLevelFlags milter_log_level_flags_from_string  (const gchar *level_name,
                                                             MilterLogLevelFlags base_flags,
                                                             GError **error);
    MilterLogger *      milter_logger                       (void);
    void                milter_logger_default_log_handler   (MilterLogger *logger,
                                                             const gchar *domain,
                                                             MilterLogLevelFlags level,
                                                             const gchar *file,
                                                             guint line,
                                                             const gchar *function,
                                                             GTimeVal *time_value,
                                                             const gchar *message,
                                                             gpointer user_data);
    MilterLogger *      milter_logger_new                   (void);
    void                milter_logger_log                   (MilterLogger *logger,
                                                             const gchar *domain,
                                                             MilterLogLevelFlags level,
                                                             const gchar *file,
                                                             guint line,
                                                             const gchar *function,
                                                             const gchar *format,
                                                             ...);
    void                milter_logger_log_va_list           (MilterLogger *logger,
                                                             const gchar *domain,
                                                             MilterLogLevelFlags level,
                                                             const gchar *file,
                                                             guint line,
                                                             const gchar *function,
                                                             const gchar *format,
                                                             va_list args);
    MilterLogLevelFlags milter_logger_get_target_level      (MilterLogger *logger);
    void                milter_logger_set_target_level      (MilterLogger *logger,
                                                             MilterLogLevelFlags level);

## 説明

## 詳細

### milter_log()

    #define             milter_log(level, format, ...)

### milter_error()

    #define             milter_error(format, ...)

### milter_critical()

    #define             milter_critical(format, ...)

### milter_message()

    #define             milter_message(format, ...)

### milter_warning()

    #define             milter_warning(format, ...)

### milter_debug()

    #define             milter_debug(format, ...)

### milter_info()

    #define             milter_info(format, ...)

### milter_statistics()

    #define             milter_statistics(format, ...)

### enum MilterLogLevelFlags

    typedef enum {
        MILTER_LOG_LEVEL_DEFAULT    = 0,
        MILTER_LOG_LEVEL_NONE       = 1 << 0,
        MILTER_LOG_LEVEL_CRITICAL   = 1 << 1,
        MILTER_LOG_LEVEL_ERROR      = 1 << 2,
        MILTER_LOG_LEVEL_WARNING    = 1 << 3,
        MILTER_LOG_LEVEL_MESSAGE    = 1 << 4,
        MILTER_LOG_LEVEL_INFO       = 1 << 5,
        MILTER_LOG_LEVEL_DEBUG      = 1 << 6,
        MILTER_LOG_LEVEL_TRACE      = 1 << 7,
        MILTER_LOG_LEVEL_STATISTICS = 1 << 8,
        MILTER_LOG_LEVEL_PROFILE    = 1 << 9
    } MilterLogLevelFlags;

### MILTER_LOG_LEVEL_ALL

    #define             MILTER_LOG_LEVEL_ALL

### enum MilterLogItemFlags

    typedef enum {
        MILTER_LOG_ITEM_DEFAULT     = 0,
        MILTER_LOG_ITEM_NONE        = 1 << 0,
        MILTER_LOG_ITEM_DOMAIN      = 1 << 1,
        MILTER_LOG_ITEM_LEVEL       = 1 << 2,
        MILTER_LOG_ITEM_LOCATION    = 1 << 3,
        MILTER_LOG_ITEM_TIME        = 1 << 4,
        MILTER_LOG_ITEM_NAME        = 1 << 5,
        MILTER_LOG_ITEM_PID         = 1 << 6
    } MilterLogItemFlags;

### MILTER_LOG_ITEM_ALL

    #define             MILTER_LOG_ITEM_ALL

### enum MilterLogColorize

    typedef enum {
        MILTER_LOG_COLORIZE_DEFAULT,
        MILTER_LOG_COLORIZE_NONE,
        MILTER_LOG_COLORIZE_CONSOLE
    } MilterLogColorize;

### struct MilterLogger

    struct MilterLogger {
        GObject object;
    };

### milter_logger_error_quark ()

    GQuark              milter_logger_error_quark           (void);

### milter_log_level_flags_from_string ()

    MilterLogLevelFlags milter_log_level_flags_from_string  (const gchar *level_name,
                                                             MilterLogLevelFlags base_flags,
                                                             GError **error);

### milter_logger ()

    MilterLogger *      milter_logger                       (void);

### milter_logger_default_log_handler ()

    void                milter_logger_default_log_handler   (MilterLogger *logger,
                                                             const gchar *domain,
                                                             MilterLogLevelFlags level,
                                                             const gchar *file,
                                                             guint line,
                                                             const gchar *function,
                                                             GTimeVal *time_value,
                                                             const gchar *message,
                                                             gpointer user_data);

### milter_logger_new ()

    MilterLogger *      milter_logger_new                   (void);

### milter_logger_log ()

    void                milter_logger_log                   (MilterLogger *logger,
                                                             const gchar *domain,
                                                             MilterLogLevelFlags level,
                                                             const gchar *file,
                                                             guint line,
                                                             const gchar *function,
                                                             const gchar *format,
                                                             ...);

### milter_logger_log_va_list ()

    void                milter_logger_log_va_list           (MilterLogger *logger,
                                                             const gchar *domain,
                                                             MilterLogLevelFlags level,
                                                             const gchar *file,
                                                             guint line,
                                                             const gchar *function,
                                                             const gchar *format,
                                                             va_list args);

### milter_logger_get_target_level ()

    MilterLogLevelFlags milter_logger_get_target_level      (MilterLogger *logger);

### milter_logger_set_target_level ()

    void                milter_logger_set_target_level      (MilterLogger *logger,
                                                             MilterLogLevelFlags level);