Added better logging and browser support.
We still need to work on the Linux browser a bit.
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (c) 2021 William Hubbard. All Rights Reserved.
|
||||
*/
|
||||
|
||||
package edu.regis.universeplayer.addon;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class Main
|
||||
{
|
||||
private static Logger logger = LoggerFactory.getLogger(Main.class);
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
boolean running = true;
|
||||
logger.info("This is an INFO level log message!");
|
||||
logger.error("This is an ERROR level log message!");
|
||||
logger.warn("This could be problimatic");
|
||||
logger.info("https://sematext.com/blog/log4j2-tutorial/#toc-log4j-2-configuration-1");
|
||||
while (running)
|
||||
{
|
||||
logger.info("Waiting1");
|
||||
logger.debug("Waiting");
|
||||
try
|
||||
{
|
||||
Thread.sleep(500);
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
logger.trace("Something interrupted us", e);
|
||||
running = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
21
addonInter/src/main/resources/log4j2.xml
Normal file
21
addonInter/src/main/resources/log4j2.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!--
|
||||
~ Copyright (c) 2021 William Hubbard. All Rights Reserved.
|
||||
-->
|
||||
<Configuration status="WARN">
|
||||
<Appenders>
|
||||
<Console name="Console" target="SYSTEM_OUT">
|
||||
<PatternLayout pattern="%d%c%L %-5level - %msg%n"/>
|
||||
</Console>
|
||||
<File name="File" fileName="addonInter.log" append="false">
|
||||
<PatternLayout>
|
||||
<Pattern>%d{HH:mm:ss.SSS} - %45c:%-4L - %-5level - %msg%n</Pattern>
|
||||
</PatternLayout>
|
||||
</File>
|
||||
</Appenders>
|
||||
<Loggers>
|
||||
<Root level="debug">
|
||||
<AppenderRef ref="File"/>
|
||||
</Root>
|
||||
</Loggers>
|
||||
</Configuration>
|
||||
Reference in New Issue
Block a user