Skip to content
Daan van Yperen edited this page Jun 1, 2019 · 3 revisions

All platforms

Logging API Plugin

Provides a lightweight logging facade that brings logging to your systems and plugins. Comes with an extendable API and a premade libGDX implementation which works on all platforms.

Before you use this plugin consider using SLF4J. You want to use this plugin when SLF4J is not an option due to platform or dependency limitations.

Artifact

<dependency>
        <groupId>net.mostlyoriginal.artemis-odb</groupId>
        <artifactId>contrib-plugin-logging-api</artifactId>
        <version>2.4.0</version>
</dependency>

<dependency>
        <groupId>net.mostlyoriginal.artemis-odb</groupId>
        <artifactId>contrib-plugin-logging-libgdx</artifactId>
        <version>2.4.0</version>
</dependency>

Usage

Extend LoggingPlugin or use the pre-existing LibgdxLoggingPlugin.

  // register the plugin on your world configuration builder.  
  worldConfigurationBuilder.dependsOn(LibgdxLoggingPlugin.class);
public class MySystem extends IteratingSystem {

   // Injected by artemis-odb.
   private Log log;

   @Override
   protected void process(int entityId) {
      log.info("MySystem processing an entity.");
   }
}