|
2 weeks ago | |
---|---|---|
src | 2 weeks ago | |
.env | 2 weeks ago | |
.gitignore | 2 years ago | |
README.md | 2 weeks ago | |
pom.xml | 2 weeks ago |
A basic application logger.
Include the library in your project by adding the following dependency to your pom.xml
<dependency>
<groupId>com.mclarkdev.tools</groupId>
<artifactId>liblog</artifactId>
<version>1.5.1</version>
</dependency>
Default configuraion values can be modified by setting environment variables prior to launching the application.
LOG_DIR Set the path where log files will be created. (logs)
LOG_NAME Set the base name of the default log file. (server)
LOG_DEBUG Set any value to enable debug logging.
Invoke any of the LibLog methods anywhere your application should produce a log message.
LibLog._log("This is a log message.");
LibLog._logF("Hello, %s", "world");
Load localized strings based on the users default language.
String lang = LibArgs.instance().getString(//
"language", Locale.getDefault().toString());
// Load localized message codes
LibLog._logF("Loading Language Pack: %s", lang);
LibLog.loadStrings(ServerLauncher.class.getResourceAsStream(//
String.format("/strings/codes.%s.properties", lang)));
Use logc methods to resolve logger codes to localized messages.
LibLog._clog("I0001");
Open source & free for all. ❤