Initializing the engine
To initialize the sos!engine, simply add this to the initialization code of your application:
Engine.initialize();
... or if you want error handling (recommended):
try {
Engine.initialize();
} catch (Exception exception) {
// Make sure this kills your
// game or application. This
// example is assuming that this
// code lives inside a Main class.
return;
}
This is enough to initialize the core engine and all subsystems found in the classpath. No need to manually initialize them.
Printing something
Now you'll probably want to print some log output. Before you try using System.out#println
,
java.util.logging
, Log4J, SLF4J or some other logging library, please don't! The engine
provides it's own logging implementation and is HIGHLY recommended to be used over other implementations.
There are eight log levels you can use:
LEVEL | METHOD NAME | DESCRIPTION |
---|---|---|
`DIAGNOSTIC` | `diag` | Detailed information about what is happening |
`VERBOSE` | `verb` | Additional information about what is happening |
`SILENT_WARNING` | `sarn` | Less important warnings. Useful for logging parsing errors and such |
`INFORMATIONAL` | `info` | Useful information about what is happening |
`WARNING` | `warn` | Warnings about dangerous, deprecated or weird behaviour |
`ERROR` | `error` | Non-fatal errors |
`CRASH` | `crash` | Fatal errors which may or may not halt the running program (see below) |