SimGrid  3.19.1
Versatile Simulation of Distributed Systems

Detailed Description

A generic logging facility in the spirit of log4j (grounding feature)

For more information, please refer to Simulation Logging Section.

Modules

 Existing log categories
 (automatically extracted)
 

Macros

#define XBT_LOG_STATIC_THRESHOLD   xbt_log_priority_none
 All logging requests with priority < XBT_LOG_STATIC_THRESHOLD are disabled at compile time, i.e., compiled out. More...
 
#define XBT_LOG_NEW_SUBCATEGORY(catName, parent, desc)
 
#define XBT_LOG_NEW_CATEGORY(catName, desc)
 
#define XBT_LOG_DEFAULT_CATEGORY(cname)
 
#define XBT_LOG_NEW_DEFAULT_CATEGORY(cname, desc)
 
#define XBT_LOG_NEW_DEFAULT_SUBCATEGORY(cname, parent, desc)
 
#define XBT_LOG_EXTERNAL_CATEGORY(cname)
 
#define XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(cname)
 
#define XBT_LOG_ISENABLED(catName, priority)
 
#define XBT_CDEBUG(categ, ...)
 Log an event at the DEBUG priority on the specified category with these args. More...
 
#define XBT_CVERB(categ, ...)
 Log an event at the VERB priority on the specified category with these args. More...
 
#define XBT_CINFO(categ, ...)
 Log an event at the INFO priority on the specified category with these args. More...
 
#define XBT_CWARN(categ, ...)
 Log an event at the WARN priority on the specified category with these args. More...
 
#define XBT_CERROR(categ, ...)
 Log an event at the ERROR priority on the specified category with these args. More...
 
#define XBT_CCRITICAL(categ, ...)
 Log an event at the CRITICAL priority on the specified category with these args (CCRITICALn exists for any n<10). More...
 
#define XBT_DEBUG(...)
 Log an event at the DEBUG priority on the default category with these args. More...
 
#define XBT_VERB(...)
 Log an event at the VERB priority on the default category with these args. More...
 
#define XBT_INFO(...)
 Log an event at the INFO priority on the default category with these args. More...
 
#define XBT_WARN(...)
 Log an event at the WARN priority on the default category with these args. More...
 
#define XBT_ERROR(...)
 Log an event at the ERROR priority on the default category with these args. More...
 
#define XBT_CRITICAL(...)
 Log an event at the CRITICAL priority on the default category with these args. More...
 
#define XBT_IN(...)
 Log at TRACE priority that we entered in current function, appending a user specified format. More...
 
#define XBT_OUT(...)
 Log at TRACE priority that we exited the current function, appending a user specified format. More...
 
#define XBT_HERE(...)
 Log at TRACE priority a message indicating that we reached that point, appending a user specified format. More...
 

Enumerations

enum  e_xbt_log_priority_t {
  xbt_log_priority_trace = 1, xbt_log_priority_debug = 2, xbt_log_priority_verbose = 3, xbt_log_priority_info = 4,
  xbt_log_priority_warning = 5, xbt_log_priority_error = 6, xbt_log_priority_critical = 7, xbt_log_priority_infinite = 8
}
 Log prioritiesThe different existing priorities. More...
 

Functions

void xbt_log_control_set (const char *control_string)
 

Macro Definition Documentation

◆ XBT_LOG_STATIC_THRESHOLD

#define XBT_LOG_STATIC_THRESHOLD   xbt_log_priority_none

All logging requests with priority < XBT_LOG_STATIC_THRESHOLD are disabled at compile time, i.e., compiled out.

◆ XBT_LOG_NEW_SUBCATEGORY

#define XBT_LOG_NEW_SUBCATEGORY (   catName,
  parent,
  desc 
)
Parameters
catNamename of new category
parentfather of the new category in the tree
descstring describing the purpose of this category

Defines a new subcategory of the parent.

◆ XBT_LOG_NEW_CATEGORY

#define XBT_LOG_NEW_CATEGORY (   catName,
  desc 
)
Parameters
catNamename of new category
descstring describing the purpose of this category

Creates a new subcategory of the root category.

◆ XBT_LOG_DEFAULT_CATEGORY

#define XBT_LOG_DEFAULT_CATEGORY (   cname)
Parameters
cnamename of the cat

Indicates which category is the default one.

◆ XBT_LOG_NEW_DEFAULT_CATEGORY

#define XBT_LOG_NEW_DEFAULT_CATEGORY (   cname,
  desc 
)
Parameters
cnamename of the cat
descstring describing the purpose of this category

Creates a new subcategory of the root category and makes it the default (used by macros that don't explicitly specify a category).

Examples:
doc/tuto-msg/masterworker-sol1.c, doc/tuto-msg/masterworker-sol2.c, doc/tuto-msg/masterworker-sol3.c, doc/tuto-msg/masterworker-sol4.c, doc/tuto-msg/masterworker.c, examples/msg/app-masterworker/app-masterworker.c, examples/msg/network-ns3/network-ns3.c, examples/msg/trace-host-user-variables/trace-host-user-variables.c, examples/msg/trace-masterworker/trace-masterworker.c, examples/s4u/actor-create/s4u-actor-create.cpp, examples/s4u/actor-daemon/s4u-actor-daemon.cpp, examples/s4u/actor-join/s4u-actor-join.cpp, examples/s4u/actor-kill/s4u-actor-kill.cpp, examples/s4u/actor-lifetime/s4u-actor-lifetime.cpp, examples/s4u/actor-migration/s4u-actor-migration.cpp, examples/s4u/actor-suspend/s4u-actor-suspend.cpp, examples/s4u/actor-yield/s4u-actor-yield.cpp, examples/s4u/app-chainsend/s4u-app-chainsend.cpp, examples/s4u/app-masterworker/s4u-app-masterworker.cpp, examples/s4u/app-pingpong/s4u-app-pingpong.cpp, examples/s4u/app-token-ring/s4u-app-token-ring.cpp, examples/s4u/async-wait/s4u-async-wait.cpp, examples/s4u/async-waitall/s4u-async-waitall.cpp, examples/s4u/async-waitany/s4u-async-waitany.cpp, examples/s4u/dht-chord/s4u-dht-chord.cpp, examples/s4u/energy-boot/s4u-energy-boot.cpp, examples/s4u/energy-exec/s4u-energy-exec.cpp, examples/s4u/energy-link/s4u-energy-link.cpp, examples/s4u/exec-async/s4u-exec-async.cpp, examples/s4u/exec-basic/s4u-exec-basic.cpp, examples/s4u/exec-dvfs/s4u-exec-dvfs.cpp, examples/s4u/exec-monitor/s4u-exec-monitor.cpp, examples/s4u/exec-ptask/s4u-exec-ptask.cpp, examples/s4u/exec-remote/s4u-exec-remote.cpp, examples/s4u/io-file-remote/s4u-io-file-remote.cpp, examples/s4u/io-file-system/s4u-io-file-system.cpp, examples/s4u/io-storage-raw/s4u-io-storage-raw.cpp, examples/s4u/mutex/s4u-mutex.cpp, examples/s4u/platform-properties/s4u-platform-properties.cpp, examples/s4u/replay-comm/s4u-replay-comm.cpp, and examples/s4u/replay-storage/s4u-replay-storage.cpp.

◆ XBT_LOG_NEW_DEFAULT_SUBCATEGORY

#define XBT_LOG_NEW_DEFAULT_SUBCATEGORY (   cname,
  parent,
  desc 
)
Parameters
cnamename of the cat
parentname of the parent
descstring describing the purpose of this category

Creates a new subcategory of the parent category and makes it the default (used by macros that don't explicitly specify a category).

◆ XBT_LOG_EXTERNAL_CATEGORY

#define XBT_LOG_EXTERNAL_CATEGORY (   cname)
Parameters
cnamename of the cat

Indicates that a category you'll use in this file (e.g., to get subcategories of it) really lives in another file.

◆ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY

#define XBT_LOG_EXTERNAL_DEFAULT_CATEGORY (   cname)
Parameters
cnamename of the cat

Indicates that the default category of this file was declared in another file.

◆ XBT_LOG_ISENABLED

#define XBT_LOG_ISENABLED (   catName,
  priority 
)
Parameters
catNamename of the category
priorityminimal priority to be enabled to return true (must be e_xbt_log_priority_t)

Returns true if the given priority is enabled for the category. If you have expensive expressions that are computed outside of the log command and used only within it, you should make its evaluation conditional using this macro.

Examples:
examples/s4u/replay-comm/s4u-replay-comm.cpp, and examples/s4u/replay-storage/s4u-replay-storage.cpp.

◆ XBT_CDEBUG

#define XBT_CDEBUG (   categ,
  ... 
)

Log an event at the DEBUG priority on the specified category with these args.

Parameters
categthe category on which to log
...the format string and its arguments

◆ XBT_CVERB

#define XBT_CVERB (   categ,
  ... 
)

Log an event at the VERB priority on the specified category with these args.

◆ XBT_CINFO

#define XBT_CINFO (   categ,
  ... 
)

Log an event at the INFO priority on the specified category with these args.

◆ XBT_CWARN

#define XBT_CWARN (   categ,
  ... 
)

Log an event at the WARN priority on the specified category with these args.

◆ XBT_CERROR

#define XBT_CERROR (   categ,
  ... 
)

Log an event at the ERROR priority on the specified category with these args.

◆ XBT_CCRITICAL

#define XBT_CCRITICAL (   categ,
  ... 
)

Log an event at the CRITICAL priority on the specified category with these args (CCRITICALn exists for any n<10).

◆ XBT_DEBUG

#define XBT_DEBUG (   ...)

◆ XBT_VERB

#define XBT_VERB (   ...)

Log an event at the VERB priority on the default category with these args.

Examples:
examples/s4u/replay-comm/s4u-replay-comm.cpp, and examples/s4u/replay-storage/s4u-replay-storage.cpp.

◆ XBT_INFO

#define XBT_INFO (   ...)

Log an event at the INFO priority on the default category with these args.

Examples:
doc/tuto-msg/masterworker-sol1.c, doc/tuto-msg/masterworker-sol2.c, doc/tuto-msg/masterworker-sol3.c, doc/tuto-msg/masterworker-sol4.c, doc/tuto-msg/masterworker.c, examples/msg/app-masterworker/app-masterworker.c, examples/msg/network-ns3/network-ns3.c, examples/msg/trace-host-user-variables/trace-host-user-variables.c, examples/msg/trace-masterworker/trace-masterworker.c, examples/s4u/actor-create/s4u-actor-create.cpp, examples/s4u/actor-daemon/s4u-actor-daemon.cpp, examples/s4u/actor-join/s4u-actor-join.cpp, examples/s4u/actor-kill/s4u-actor-kill.cpp, examples/s4u/actor-lifetime/s4u-actor-lifetime.cpp, examples/s4u/actor-migration/s4u-actor-migration.cpp, examples/s4u/actor-suspend/s4u-actor-suspend.cpp, examples/s4u/actor-yield/s4u-actor-yield.cpp, examples/s4u/app-chainsend/s4u-app-chainsend.cpp, examples/s4u/app-masterworker/s4u-app-masterworker.cpp, examples/s4u/app-pingpong/s4u-app-pingpong.cpp, examples/s4u/app-token-ring/s4u-app-token-ring.cpp, examples/s4u/async-wait/s4u-async-wait.cpp, examples/s4u/async-waitall/s4u-async-waitall.cpp, examples/s4u/async-waitany/s4u-async-waitany.cpp, examples/s4u/dht-chord/s4u-dht-chord.cpp, examples/s4u/energy-boot/s4u-energy-boot.cpp, examples/s4u/energy-exec/s4u-energy-exec.cpp, examples/s4u/energy-link/s4u-energy-link.cpp, examples/s4u/exec-async/s4u-exec-async.cpp, examples/s4u/exec-basic/s4u-exec-basic.cpp, examples/s4u/exec-dvfs/s4u-exec-dvfs.cpp, examples/s4u/exec-monitor/s4u-exec-monitor.cpp, examples/s4u/exec-ptask/s4u-exec-ptask.cpp, examples/s4u/exec-remote/s4u-exec-remote.cpp, examples/s4u/io-file-remote/s4u-io-file-remote.cpp, examples/s4u/io-file-system/s4u-io-file-system.cpp, examples/s4u/io-storage-raw/s4u-io-storage-raw.cpp, examples/s4u/mutex/s4u-mutex.cpp, examples/s4u/platform-properties/s4u-platform-properties.cpp, examples/s4u/replay-comm/s4u-replay-comm.cpp, and examples/s4u/replay-storage/s4u-replay-storage.cpp.

◆ XBT_WARN

#define XBT_WARN (   ...)

Log an event at the WARN priority on the default category with these args.

Examples:
examples/s4u/exec-ptask/s4u-exec-ptask.cpp.

◆ XBT_ERROR

#define XBT_ERROR (   ...)

Log an event at the ERROR priority on the default category with these args.

◆ XBT_CRITICAL

#define XBT_CRITICAL (   ...)

Log an event at the CRITICAL priority on the default category with these args.

◆ XBT_IN

#define XBT_IN (   ...)

Log at TRACE priority that we entered in current function, appending a user specified format.

◆ XBT_OUT

#define XBT_OUT (   ...)

Log at TRACE priority that we exited the current function, appending a user specified format.

◆ XBT_HERE

#define XBT_HERE (   ...)

Log at TRACE priority a message indicating that we reached that point, appending a user specified format.

Enumeration Type Documentation

◆ e_xbt_log_priority_t

Log prioritiesThe different existing priorities.

Enumerator
xbt_log_priority_trace 

enter and return of some functions

xbt_log_priority_debug 

crufty output

xbt_log_priority_verbose 

verbose output for the user wanting more

xbt_log_priority_info 

output about the regular functionning

xbt_log_priority_warning 

minor issue encountered

xbt_log_priority_error 

issue encountered

xbt_log_priority_critical 

major issue encountered

xbt_log_priority_infinite 

value for XBT_LOG_STATIC_THRESHOLD to not log

Function Documentation

◆ xbt_log_control_set()

void xbt_log_control_set ( const char *  control_string)
Parameters
control_stringWhat to parse

Typically passed a command-line argument. The string has the syntax:

 ( [category] "." [keyword] ":" value (" ")... )...

where [category] is one the category names (see Existing log categories for a complete list of the ones defined in the SimGrid library) and keyword is one of the following:

  • thres: category's threshold priority. Possible values: TRACE,DEBUG,VERBOSE,INFO,WARNING,ERROR,CRITICAL
  • add or additivity: whether the logging actions must be passed to the parent category. Possible values: 0, 1, no, yes, on, off. Default value: yes.
  • fmt: the format to use. See Format configuration for more information.
  • app or appender: the appender to use. See Category appender for more information.