Author Topic: Logger listener  (Read 752 times)

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Logger listener
« on: January 28, 2013, 11:17:57 pm »
Please, could you implement listener for Logger? It is for testing on many devices and easier debugging. I want to save warning and error messages into file. Thanks

something like:
Code: [Select]
public void log(String msg, int type);

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: Logger listener
« Reply #1 on: January 29, 2013, 07:09:39 am »
I'll have a look...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: Logger listener
« Reply #2 on: January 29, 2013, 10:15:04 pm »
Here you go: http://jpct.de/download/beta/jpct_ae.jar

I've added an interface called LogHandler that you can implement. It basically uses the signature you suggested but adds a return value. If you return true, jPCT-AE's Logger will continue with it's normal logging operation after returning from the method. If you return false, no logging will be done and no exceptions will be raised. It's up to you to handle that is this case.
« Last Edit: January 29, 2013, 11:55:34 pm by EgonOlsen »

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: Logger listener
« Reply #3 on: January 29, 2013, 10:25:54 pm »
Great! thanks ;)