Page tree

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.

0.3.1 Release Notes

Bug Fix


0.3.0 Release Notes

New Features

  • Colored logs!
  • Clickable location in Eclipse is back (added ".java")
    Image Removed
    Image Removed

Bug fixes

  • Fix bug where setting `-Dlog.level=warn` would not set `us.ihmc` classes (
    serverJIRA IHMC
  • Fix bug where order made a difference when setting multiple levels

0.2.2 Release Notes


  • Add logger name to all messages logged by non-IHMC loggers, as they do not normally include their source
  • Use new date/time format: 20181005 13:13 [INFO] (LogTools:151): Granular logging mode enabled. Not realtime safe. 20181005 13:13 [ERROR] (LogToolsDemo:37): Demo there 20181005 13:13 [WARN] (LogToolsDemo:38): var1: 9, var2: false 20181005 13:13 [INFO] (LogToolsDemo:39): Demo there 20181005 13:13 [DEBUG] (LogToolsDemo:29): Hi I'm subclass 2

Bug fix

  • Fix Gradle user logging properties not getting through to deployed applications

0.1.7 Release Notes

Bug Fix

  • Add slf4j impl compatibility runtime library to fix external SLF4J logger bindings

0.1.6 Release Notes

Initial release!


  • Zero-configuration required API. Use"msg") right out of the box, from anywhere.
  • Realtime safe by default as long as info and higher level messages are non-recurring.
  • Provides Java and Gradle properties for setting log levels.
  • Granular non-realtime mode for setting log levels of packages and classes.
  • Adds class name and line number to all log entries.


plugins { id "us.ihmc.log-tools" version DownloadImage Removed } // Gradle plugin

compile group: "us.ihmc", name: "log-tools", version: DownloadImage Removed` // API`


To log messages, use the static LogTools methods.

Log tools provides the following log levels: off, fatal, error, warn, info, debug, trace, and all.

Each levels has no special behavior other than it's importance to the end user. fatal is most important and trace is least important. Find conventional meanings for the levels here:

To set log levels you can pass JVM arguments: - -Dlog.level=<level>: Set root log level, including all software on the classpath that uses SLF4J compatible log APIs. - -Dlog.granular=<true|false>: Enable granular mode, allowing setting levels for arbitrary classpaths. (NOT realtime safe) -<level>: Set the log level of all IHMC software. In granular mode, this instead refers to all code in the us.ihmc package. - -Dlog.level.<classpathPrefix>=<level>: If granular mode is true or unset: Set the log level of a package or class.

Note: For convenience, granular mode is automatically activates when at least one -Dlog.level.<classpathPrefix>=<level> is present. Setting<level> or -Dlog.level=<level> will NOT enable granular mode and are always safe to use.


<pass nothing>    // all log levels set to info, realtime safe

-Dlog.level=info   // same as default, realtime safe

-Dlog.level=off   // disable all SLF4J compatable logging, realtime safe   // debug IHMC software only, realtime safe   // debug behaviors package only, NOT realtime safe   // Enables trace level on YoDouble class, NOT realtime safe

-Dlog.granular=true   // Enables trace level on YoDouble class, NOT realtime safe

-Dlog.granular=false   // Does NOT enable trace level on YoDouble class, realtime safe

Realtime safety

To ensure your code is realtime safe:

  1. Never build strings in a LogTools call.
  2. Use the LogTools.xxxx("var1: {}, var2: {}", var1, var2) methods to build strings from variables.
  3. Use a message Supplier to build complex messages, but do not inline it.
  4. Do not log info, warn, error, or fatal levels more than a predetermined maximum amount.
    • If an error message is printed on some math failure, have a counter such that it becomes silent after 5 or so occurances.
  5. Do not set -Dlog.granular=true or set any levels by package or class.
    • You may safely use -Dlog.level=level to set the global level (including non-ihmc messages)
    • You may safely use to set the log level of everything going though the LogTools API
    • You may NOT safely set any other log level i.e. -Dlog.level.*, unless you explicity set -Dlog.granular=false, which sets to ignore all -Dlog.level.* property. This is to make it convenient to quickly switch between modes without deleting complex level settings.

Some examples:"str1 {}", someStrVariable)    // SAFE"str1" + someStrVariable)      // NOT realtime safe

Supplier<String> supplier = () -> "string" + "builder";  // as field or existing method, created once
[...] // SAFE -> { "string" + "builder"})   // NOT realtime safe, allocates new Supplier<String>()

Gradle plugin

The Gradle plugin exists solely to provide a wrapper for the JVM properties. All properties are the same as above. Just replace -D with -P.

The plugin applies the log settings to all JVMs spawned by Gradle to run your applications. This includes: - test task JVMs - Custom, user defined, JavaExec tasks - run task provided by the application plugin - Scripts generated by the installDist task provided by the application plugin

To run tests, only logging errors:


Refer to