We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpIntegration › Processing + Java Logging API
Page Index Toggle Pages: 1
Processing + Java Logging API (Read 1053 times)
Processing + Java Logging API
Mar 30th, 2010, 6:15am
 
I'm using the java logging API in my project (using processing in eclipse too). For the logging to be configured correcly, i have to read a properties file. Whenever i try to do that in the only class in my application that extends PApplet and also has a main, the application crashes.

Here's a code sample:

Code:

public class JourneyMap extends PApplet {
/**
*
*/
private static final long serialVersionUID = 4320017769386788216L;
private final static Logger LOGGER = Logger.getLogger(JourneyMap.class.getName());
private CityRecognizer cityRecognizer;
private MapRenderer mapRenderer;

public static void configureLogger() {
try {
LogManager.getLogManager().readConfiguration(new FileInputStream(new File("logging.properties")));
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}

public void setup() {
size(screen.width, screen.height);

LOGGER.info("Configuring Logger.");
configureLogger();
textFont(loadFont("Tahoma-12.vlw"));
smooth();

cityRecognizer = new CityRecognizer(this);
mapRenderer = new GenericMapRenderer(this, cityRecognizer.getPlaces("And then Fairbanks, and then Dawson Creek, and then Seattle, and then Carthage, and then Cut Bank, and then Astoria, and Orick, and then Las Vegas, and then Los Angeles, and then Grand Junction, and Niland."));
mapRenderer.calculateCoordinates();
}

public void draw() {
background(255);
mapRenderer.renderMap();
}

public static void main(String[] args) {
PApplet.main(new String[] {
"--present", "de.dfki.km.jmap.JourneyMap"
});
}

}
Re: Processing + Java Logging API
Reply #1 - Mar 30th, 2010, 6:34am
 
melhosseiny wrote on Mar 30th, 2010, 6:15am:
the application crashes

I suppose you have an error, and probably a stack trace. Can we see them
And where is the logging.properties file
Page Index Toggle Pages: 1