Are there any logging facilities? [message #1740153] |
Tue, 09 August 2016 15:58  |
Eclipse User |
|
|
|
Are there any logging facilities, maybe a robust as Python's logging?
If not, has anybody tried something similar like as follows?
Creating a wrapper service for DEBUG logs (printing to stdout).
Like so:
package project.services;
public class Logging {
public void debug(String message) {
System.out.println("DEBUG "+message);
}
}
And adding to the template the usage as so:
[('Operation ' + i +': name=' + aParameter.name + ', direction=' + aParameter.direction + ', CRUD=' + aParameter.effect).debug() /]
I find it annoying to be getting an extra line feed on the generated files.
Using the following to still set debug print on separate line, but without the line feed overhead on the 'text'...
[('Operation ' + i +': name=' + aParameter.name + ', direction=' + aParameter.direction + ', CRUD=' + aParameter.effect).debug() /][ ''
/][next logics]
This is not pretty, but does the job.
Is there a pretty way, while keeping the debug calls on independent lines?
[Updated on: Sat, 13 August 2016 11:36] by Moderator
|
|
|
|
Re: Are there any logging facilities? [message #1742917 is a reply to message #1740608] |
Thu, 08 September 2016 11:05  |
Eclipse User |
|
|
|
I use these two functions:
The first to initialize the debug file, the second to output incrementally on that file. Also produce a blank line.
[template public initDebug(category:String)]
[file (category+'.log', false, 'UTF-8')]
[/file]
[/template]
[template public debug(string:String,category:String)]
[file (category+'.log', true, 'UTF-8')]
[string/]
[/file]
[/template]
|
|
|
Powered by
FUDForum. Page generated in 0.08124 seconds