\( \usepackage{euler} % must be loaded before fontspec for the whole doc (below); this must be kept for pngmath, however \usepackage{hyperref} \usepackage{amsmath} \usepackage{amsbsy} %\usepackage{mathabx} \usepackage{underscore} \usepackage[all]{xy} % Metadata of the pdf output \hypersetup{pdftitle={Yade Documentation}} \hypersetup{pdfauthor={Smilauer, V., et al.}} \hypersetup{pdfkeywords={Discrete element method, granular materials, contact law, hydromechanical coupling}} % symbols \renewcommand{\mat}{\boldsymbol} \renewcommand{\vec}{\boldsymbol} \renewcommand{\tens}{\boldsymbol} %normalized and locfram here \def\normalized#1{\widehat{#1}} \def\locframe#1{\widetilde{#1}} % timestep \def\Dt{\Delta t} \def\Dtcr{\Dt_{\rm cr}} % algorithm complexity \def\bigO#1{{\mathcal{O}(#1)}} % variants for greek symbols \let\epsilon\varepsilon \let\theta\vartheta \let\phi\varphi % shorthands \let\sig\sigma \let\eps\epsilon % variables at different points of time \def\prev#1{#1^-} \def\pprev#1{#1^\ominus} \def\curr#1{#1^{\circ}} \def\nnext#1{#1^\oplus} \def\next#1{#1^+} % shorthands for geometry \def\currn{\curr{\vec{n}}} \def\currC{\curr{\vec{C}}} \def\uT{\vec{u}_T} \def\curruT{\curr{\vec{u}}_T} \def\prevuT{\prev{\vec{u}}_T} \def\currn{\curr{\vec{n}}} \def\prevn{\prev{\vec{n}}} % motion \def\pprevvel{\pprev{\dot{\vec{u}}}} \def\nnextvel{\nnext{\dot{\vec{u}}}} \def\curraccel{\curr{\ddot{\vec{u}}}} \def\prevpos{\prev{\vec{u}}} \def\currpos{\curr{\vec{u}}} \def\nextpos{\next{\vec{u}}} \def\curraaccel{\curr{\dot{\vec{\omega}}}} \def\pprevangvel{\pprev{\vec{\omega}}} \def\nnextangvel{\nnext{\vec{\omega}}} \def\loccurr#1{\curr{\locframe{#1}}} \def\numCPU{n_{\rm cpu}} \DeclareMathOperator{\Align}{Align} \DeclareMathOperator{\sign}{sgn} % sorting algorithms \def\isleq#1{\currelem{#1}\ar@/^/[ll]^{\leq}} \def\isnleq#1{\currelem{#1}\ar@/^/[ll]^{\not\leq}} \def\currelem#1{\fbox{$#1$}} \def\sortSep{||} \def\sortInv{\hbox{\phantom{||}}} \def\sortlines#1{\xymatrix@=3pt{#1}} \def\crossBound{||\mkern-18mu<} \)

# yade.log module

The `yade.log` module serves as an interface to yade logging framework implemented on top of boost::log. For full documentation see debugging section. Example usage in python is as follows:

    import yade.log
    yade.log.setLevel('PeriTriaxController',yade.log.TRACE)

Example usage in C++ is as follows:

    LOG_WARN("Something: "<<something)

yade._log.defaultConfigFileName() → str
  Returns:

    the default log config file, which is loaded at startup, if it exists.

yade._log.getAllLevels() → dict
  Returns:

    A python dictionary with all known loggers in yade. Those without a debug level set will have value -1 to indicate that `Default` filter log level is to be used for them.

yade._log.getDefaultLogLevel() → int
  Returns:

    The current `Default` filter log level.

yade._log.getMaxLevel() → int
  Returns:

    the MAX_LOG_LEVEL of the current yade build.

yade._log.getUsedLevels() → dict
  Returns:

    A python dictionary with all used log levels in yade. Those without a debug level (value -1) are omitted.

yade._log.readConfigFile((str)arg1) → None

  Loads the given configuration file.

  Parameters:

    fname (str) – the config file to be loaded.

yade._log.resetOutputStream() → None

  Resets log output stream to default state: all logs are printed on `std::clog` channel, which usually redirects to `std::cerr`.

yade._log.saveConfigFile((str)arg1) → None

  Saves log config to specified file.

  Parameters:

    fname (str) – the config file to be saved.

yade._log.setDefaultLogLevel((int)arg1) → None
  Parameters:

    level (int) – Sets the `Default` filter log level, same as calling `log.setLevel("Default",level)`.

yade._log.setLevel((str)arg1, (int)arg2) → None

  Set filter level (constants `TRACE` (6), `DEBUG` (5), `INFO` (4), `WARN` (3), `ERROR` (2), `FATAL` (1), `NOFILTER` (0)) for given logger.

  Parameters:

    - className (str) – The logger name for which the filter level is to be set. Use name `Default` to change the default filter level.

    - level (int) – The filter level to be set.

  Warning

  setting `Default` log level higher than `MAX_LOG_LEVEL` provided during compilation will have no effect. Logs will not be printed because they are removed during compilation.

yade._log.setOutputStream((str)arg1, (bool)arg2) → None
  Parameters:

    - streamName (str) – sets the output stream, special names `cout`, `cerr`, `clog` use the `std::cout`, `std::cerr`, `std::clog` counterpart (`std::clog` the is the default output stream). Every other name means that log will be written to a file with name provided in the argument.

    - reset (bool) – dictates whether all previously set output streams are to be removed. When set to false: the new output stream is set additionally to the current one.

yade._log.setUseColors((bool)arg1) → None

  Turn on/off colors in log messages. By default is on. If logging to a file then it is better to be turned off.

yade._log.testAllLevels() → None

  This function prints test messages on all log levels. Can be used to see how filtering works and to what streams the logs are written.

yade._log.testOnceLevels() → None

  This function prints test messages on all log levels using LOG_ONCE_* macro family.

yade._log.testTimedLevels() → None

  This function prints timed test messages on all log levels. In this test the log levels ∈ [0…2] are timed to print every 2 seconds, levels ∈ [3,4] every 1 second and levels ∈ [5,6] every 0.5 seconds. The loop lasts for 2.1 seconds. Can be used to see how timed filtering works and to what streams the logs are written.

yade._log.unsetLevel((str)arg1) → None
  Parameters:

    className (str) – The logger name for which the filter level is to be unset, so that a `Default` will be used instead. Unsetting the `Default` level will change it to max level and print everything.