On 27/12/15 19:55, Ian wrote: > On Sun, Dec 27, 2015 at 1:20 PM, Matthew Toseland <[email protected] >> wrote: >> On 26/12/15 16:03, Ian wrote: >>> Best practice is to use the logging system, using System.out.println() >> for >>> logging is almost universally regarded as bad practice, many static >>> analysis tools will automatically flag it as a problem. >>> >>> The example you gave in NodeCrypto is not best practice, that should >>> probably just be something like: >>> >>> Logger.error(this, "Could not use port: "+bindto+ ':'+portNo+": "+e, e) >> In this case it is appropriate, because the above is only shown if the >> node is about to fail to start up (at least in the darknet case). See my >> message explaining the current policy. Changing the policy may be >> appropriate, I'm just documenting the current status quo. > > Ok, but in that case this "policy" deviates from standard practice in Java > programming, which is to use a logging framework for all log messages, even > "fatal" messages. > > The exception might be in Freenet was a command-line app, but that's not > how most people use Freenet. A fatal error should ideally be reported via > FProxy, since most users aren't going to see stuff written to the console. In this particular case, it doesn't complete startup, and exits. I believe it will try to bind fproxy and continue, but if it fails to bind the darknet port it dies - after which fproxy is not running.
I agree that serious errors that don't prevent the node from running should be handled as user-alerts via fproxy. For debugging they also need to be logged, of course.
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Devl mailing list [email protected] https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
