SimGrid  3.14.159
Versatile Simulation of Distributed Systems
log.c File Reference
#include <stdarg.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include "src/internal_config.h"
#include "src/xbt_modinter.h"
#include "src/xbt/log_private.h"
#include "xbt/asserts.h"
#include "xbt/dynar.h"
#include "xbt/ex.h"
#include "xbt/misc.h"
#include "xbt/str.h"
#include "xbt/sysdep.h"
#include "xbt/xbt_os_thread.h"

Classes

struct  s_xbt_log_setting_t
 

Macros

#define XBT_LOG_STATIC_BUFFER_SIZE   2048
 
#define XBT_LOG_DYNAMIC_BUFFER_SIZE   4096
 
#define _xbt_log_cat_init(a, b)   (0)
 
#define _xbt_log_cat_init(a, b)   (0)
 
#define _xbt_log_cat_init(a, b)   (0)
 

Typedefs

typedef struct s_xbt_log_setting_txbt_log_setting_t
 

Functions

static void _free_setting (void *s)
 
static void _xbt_log_cat_apply_set (xbt_log_category_t category, xbt_log_setting_t setting)
 
s_xbt_log_category_t _XBT_LOGV (XBT_LOG_ROOT_CAT)
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (log, xbt, "Loggings from the logging mechanism itself")
 
void xbt_log_preinit (void)
 
static void xbt_log_connect_categories (void)
 
static void xbt_log_help (void)
 
static void xbt_log_help_categories (void)
 
void xbt_log_init (int *argc, char **argv)
 Get all logging settings from the command line. More...
 
static void log_cat_exit (xbt_log_category_t cat)
 
void xbt_log_postexit (void)
 
void _xbt_log_event_log (xbt_log_event_t ev, const char *fmt,...)
 
int _xbt_log_cat_init (xbt_log_category_t category, e_xbt_log_priority_t priority)
 
void xbt_log_parent_set (xbt_log_category_t cat, xbt_log_category_t parent)
 
static void _set_inherited_thresholds (xbt_log_category_t cat)
 
void xbt_log_threshold_set (xbt_log_category_t cat, e_xbt_log_priority_t threshold)
 
static xbt_log_setting_t _xbt_log_parse_setting (const char *control_string)
 
static xbt_log_category_t _xbt_log_cat_searchsub (xbt_log_category_t cat, char *name)
 
void xbt_log_control_set (const char *control_string)
 
void xbt_log_appender_set (xbt_log_category_t cat, xbt_log_appender_t app)
 
void xbt_log_layout_set (xbt_log_category_t cat, xbt_log_layout_t lay)
 
void xbt_log_additivity_set (xbt_log_category_t cat, int additivity)
 
static int xbt_log_cat_cmp (const void *pa, const void *pb)
 
static void xbt_log_help_categories_rec (xbt_log_category_t category, const char *prefix)
 

Variables

int xbt_log_no_loc = 0
 
static xbt_os_mutex_t log_cat_init_mutex = NULL
 
xbt_log_appender_t xbt_log_default_appender = NULL
 
xbt_log_layout_t xbt_log_default_layout = NULL
 
static xbt_dynar_t xbt_log_settings = NULL
 
const char * xbt_log_priority_names [8]
 

Macro Definition Documentation

§ XBT_LOG_STATIC_BUFFER_SIZE

#define XBT_LOG_STATIC_BUFFER_SIZE   2048

§ XBT_LOG_DYNAMIC_BUFFER_SIZE

#define XBT_LOG_DYNAMIC_BUFFER_SIZE   4096

§ _xbt_log_cat_init [1/3]

#define _xbt_log_cat_init (   a,
 
)    (0)

§ _xbt_log_cat_init [2/3]

#define _xbt_log_cat_init (   a,
 
)    (0)

§ _xbt_log_cat_init [3/3]

#define _xbt_log_cat_init (   a,
 
)    (0)

Typedef Documentation

§ xbt_log_setting_t

Function Documentation

§ _free_setting()

static void _free_setting ( void s)
static

§ _xbt_log_cat_apply_set()

static void _xbt_log_cat_apply_set ( xbt_log_category_t  category,
xbt_log_setting_t  setting 
)
static

§ _XBT_LOGV()

§ XBT_LOG_NEW_DEFAULT_SUBCATEGORY()

XBT_LOG_NEW_DEFAULT_SUBCATEGORY ( log  ,
xbt  ,
"Loggings from the logging mechanism itself"   
)

§ xbt_log_preinit()

void xbt_log_preinit ( void  )

§ xbt_log_connect_categories()

static void xbt_log_connect_categories ( void  )
static

§ xbt_log_help()

static void xbt_log_help ( void  )
static

§ xbt_log_help_categories()

static void xbt_log_help_categories ( void  )
static

§ xbt_log_init()

void xbt_log_init ( int *  argc,
char **  argv 
)

Get all logging settings from the command line.

xbt_log_control_set() is called on each string we got from cmd line

§ log_cat_exit()

static void log_cat_exit ( xbt_log_category_t  cat)
static

§ xbt_log_postexit()

void xbt_log_postexit ( void  )

§ _xbt_log_event_log()

void _xbt_log_event_log ( xbt_log_event_t  ev,
const char *  fmt,
  ... 
)

§ _xbt_log_cat_init()

int _xbt_log_cat_init ( xbt_log_category_t  category,
e_xbt_log_priority_t  priority 
)

§ xbt_log_parent_set()

void xbt_log_parent_set ( xbt_log_category_t  cat,
xbt_log_category_t  parent 
)
Parameters
catthe category (not only its name, but the variable)
parentthe parent cat

Programatically alter a category's parent (don't use).

§ _set_inherited_thresholds()

static void _set_inherited_thresholds ( xbt_log_category_t  cat)
static

§ xbt_log_threshold_set()

void xbt_log_threshold_set ( xbt_log_category_t  cat,
e_xbt_log_priority_t  thresholdPriority 
)
Parameters
catthe category (not only its name, but the variable)
thresholdPrioritythe priority

Programatically alters a category's threshold priority (don't use).

§ _xbt_log_parse_setting()

static xbt_log_setting_t _xbt_log_parse_setting ( const char *  control_string)
static

§ _xbt_log_cat_searchsub()

static xbt_log_category_t _xbt_log_cat_searchsub ( xbt_log_category_t  cat,
char *  name 
)
static

§ xbt_log_appender_set()

void xbt_log_appender_set ( xbt_log_category_t  cat,
xbt_log_appender_t  app 
)
Parameters
catthe category (not only its name, but the variable)
appthe appender

Programatically sets the category's appender. (the preferred interface is through xbt_log_control_set())

§ xbt_log_layout_set()

void xbt_log_layout_set ( xbt_log_category_t  cat,
xbt_log_layout_t  lay 
)
Parameters
catthe category (not only its name, but the variable)
laythe layout

Programatically sets the category's layout. (the preferred interface is through xbt_log_control_set())

§ xbt_log_additivity_set()

void xbt_log_additivity_set ( xbt_log_category_t  cat,
int  additivity 
)
Parameters
catthe category (not only its name, but the variable)
additivitywhether logging actions must be passed to parent.

Programatically sets whether the logging actions must be passed to the parent category. (the preferred interface is through xbt_log_control_set())

§ xbt_log_cat_cmp()

static int xbt_log_cat_cmp ( const void pa,
const void pb 
)
static

§ xbt_log_help_categories_rec()

static void xbt_log_help_categories_rec ( xbt_log_category_t  category,
const char *  prefix 
)
static

Variable Documentation

§ xbt_log_no_loc

int xbt_log_no_loc = 0

§ log_cat_init_mutex

xbt_os_mutex_t log_cat_init_mutex = NULL
static

§ xbt_log_default_appender

xbt_log_appender_t xbt_log_default_appender = NULL

§ xbt_log_default_layout

xbt_log_layout_t xbt_log_default_layout = NULL

§ xbt_log_settings

xbt_dynar_t xbt_log_settings = NULL
static

§ xbt_log_priority_names

const char* xbt_log_priority_names[8]
Initial value:
= {
"NONE",
"TRACE",
"DEBUG",
"VERBOSE",
"INFO",
"WARNING",
"ERROR",
"CRITICAL"
}