<commit_before>/****h* libZT/Logging
 * DESCRIPTION
 *
 * COPYRIGHT
 *   Copyright (C) 2000-2005, <NAME> <<EMAIL>>.
 *   All Rights Reserved.
 *   See file COPYING for details.
 *
 ****/

#ifndef _ZT_LOG_H_
#define _ZT_LOG_H_

#include <stdarg.h>
#include <libzt/zt.h>
#include <libzt/zt_progname.h>

/****d* Logging/LOG_RAW
 *  NAME
 *    LOG_RAW
 *****/
#define LOG_RAW           0

/****d* Logging/LOG_WITH_DATE
 *  NAME
 *    LOG_WITH_DATE
 *****/
#define LOG_WITH_DATE     1

/****d* Logging/LOG_WITH_LEVEL
 *  NAME
 *    LOG_WITH_LEVEL
 *****/
#define LOG_WITH_LEVEL    2

/****d* Logging/LOG_WITH_SYSNAME
 *  NAME
 *    LOG_WITH_SYSNAME
 *****/
#define LOG_WITH_SYSNAME  4

/****d* Logging/LOG_WITH_PROGNAME
 *  NAME
 *    LOG_WITH_PROGNAME
 *****/
#define LOG_WITH_PROGNAME 8

/****d* Logging/LOG_WITH_PID
 *  NAME
 *    LOG_WITH_PID
 *****/
#define LOG_WITH_PID      16

/****d* Logging/LOG_EMU_SYSLOG
 *  NAME
 *    LOG_EMU_SYSLOG
 *****/
#define LOG_EMU_SYSLOG    (LOG_WITH_DATE | LOG_WITH_SYSNAME | LOG_WITH_PROGNAME | LOG_WITH_PID)

BEGIN_C_DECLS

typedef enum log_level log_level;
enum log_level {
  log_emerg = 0,
  log_alert,
  log_crit,
  log_err,
  log_warning,
  log_notice,
  log_info,
  log_debug,
  log_max,
};

typedef struct log_ty log_ty;

extern log_level log_set_level _(( log_ty *log, log_level level ));
extern log_level log_get_level _(( log_ty *log ));

extern unsigned int log_set_opts _(( log_ty *log, unsigned int opts ));
extern unsigned int log_get_opts _(( log_ty *log ));

extern void log_set_debug_info _(( log_ty *, char *, int, char * ));
extern void log_get_debug_info _(( log_ty *, char **, int *, char ** ));

extern log_ty *log_logger _(( log_ty * ));
extern log_ty *log_debug_logger _(( log_ty * ));

extern void log_lprintf _(( log_ty *, log_level, char *, ... ));
extern void log_lvprintf _(( log_ty *, log_level, char *, va_list ));

/****d* Logging/log_printf
 *  NAME
 *    log_printf
 *****/
#define log_printf( level, fmt, args... ) \
	log_lprintf( NULL, level, fmt, ##args )

/****d* Logging/log_vprintf
 *  NAME
 *    log_vprintf
 *****/
#define log_vprintf( level, fmt, ap ) \
	log_lvprintf ( NULL, level, fmt, ap )
<commit_msg>*** empty log message ***<commit_after>/****h* libZT/Logging
 * DESCRIPTION
 *
 * COPYRIGHT
 *   Copyright (C) 2000-2005, <NAME> <<EMAIL>>.
 *   All Rights Reserved.
 *   See file COPYING for details.
 *
 ****/

#ifndef _ZT_LOG_H_
#define _ZT_LOG_H_

#include <stdarg.h>
#include <libzt/zt.h>
#include <libzt/zt_progname.h>

/****d* Logging/LOG_RAW
 *  NAME
 *    LOG_RAW
 *****/
#define LOG_RAW           0

/****d* Logging/LOG_WITH_DATE
 *  NAME
 *    LOG_WITH_DATE
 *****/
#define LOG_WITH_DATE     1

/****d* Logging/LOG_WITH_LEVEL
 *  NAME
 *    LOG_WITH_LEVEL
 *****/
#define LOG_WITH_LEVEL    2

/****d* Logging/LOG_WITH_SYSNAME
 *  NAME
 *    LOG_WITH_SYSNAME
 *****/
#define LOG_WITH_SYSNAME  4

/****d* Logging/LOG_WITH_PROGNAME
 *  NAME
 *    LOG_WITH_PROGNAME
 *****/
#define LOG_WITH_PROGNAME 8

/****d* Logging/LOG_WITH_PID
 *  NAME
 *    LOG_WITH_PID
 *****/
#define LOG_WITH_PID      16

/****d* Logging/LOG_EMU_SYSLOG
 *  NAME
 *    LOG_EMU_SYSLOG
 *****/
#define LOG_EMU_SYSLOG    (LOG_WITH_DATE | LOG_WITH_SYSNAME | LOG_WITH_PROGNAME | LOG_WITH_PID)

BEGIN_C_DECLS

typedef enum log_level log_level;
enum log_level {
  log_emerg = 0,
  log_alert,
  log_crit,
  log_err,
  log_warning,
  log_notice,
  log_info,
  log_debug,
  log_max,
};

typedef struct log_ty log_ty;

extern log_level log_set_level _(( log_ty *log, log_level level ));
extern log_level log_get_level _(( log_ty *log ));

extern unsigned int log_set_opts _(( log_ty *log, unsigned int opts ));
extern unsigned int log_get_opts _(( log_ty *log ));

extern void log_set_debug_info _(( log_ty *, const char *, int, const char * ));
extern void log_get_debug_info _(( log_ty *, char **, int *, char ** ));

extern log_ty *log_logger _(( log_ty * ));
extern log_ty *log_debug_logger _(( log_ty * ));

extern void log_lprintf _(( log_ty *, log_level, char *, ... ));
extern void log_lvprintf _(( log_ty *, log_level, char *, va_list ));

/****d* Logging/log_printf
 *  NAME
 *    log_printf
 *****/
#define log_printf( level, fmt, args... ) \
	log_lprintf( NULL, level, fmt, ##args )

/****d* Logging/log_vprintf
 *  NAME
 *    log_vprintf
 *****/
#define log_vprintf( level, fmt, ap ) \
	log_lvprintf ( NULL, level, fmt, ap )

{'fraction_non_alphanumeric': 0.15072859744990894, 'fraction_numerical': 0.007285974499089253, 'mean_word_length': 3.728740581270183, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3896177', 'n_tokens_mistral': 1837, 'n_tokens_neox': 1726, 'n_words': 386}