This is the mail archive of the frysk@sourceware.org mailing list for the frysk project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [SCM] master: Refactor Log to Callers.


Hi Andrew,

On Wed, 2008-02-13 at 00:05 +0000, cagney@sourceware.org wrote:
>     Refactor Log to Callers.
>     
>     frysk-core/frysk/proc/dead/ChangeLog
>     2008-02-12  Andrew Cagney  <cagney@redhat.com>
>     
>     	* LinuxCoreProc.java: Use Log.CALLER.
>     	* LinuxCoreTask.java: Ditto.
>     
>     frysk-sys/frysk/rsl/ChangeLog
>     2008-02-12  Andrew Cagney  <cagney@redhat.com>
>     
>     	* Node.java (set(Level)): Return the node.
>     	* Callers.java: Extract from Log.java.
>     	* TestCallers.java: New.
>     	* Log.java (CALLER): New.
>     	(CALLERS): New.
>     	(dump(Object)): Check for null.
>     	(set(PrintWriter)): New.
>     	(set(PrintStream)): Return old writer.

If you refactor working code could you please explain why.
The functionality does seem almost the same now, but it is far more
complex to see why it works. Depending on Callers.toString() in
Log.dump() seems somewhat fragile unless you fix the call depth that
method is called from somehow. There should at least be a warning in
Log.java to not nest log() and dump() calls that might take a CALLER or
CALLERS. Also the original code had comments for each method and field
explaining why it was necessary, what it did and how to use it. It would
be nice if the new code had the same (why is the method
Callers.callers() included for example?)

Thanks,

Mark


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]