Login | Register
My pages Projects Community openCollabNet

Discussions > users > RE: [gef-users] System.out

gef
Discussion topic

Back to topic list

RE: [gef-users] System.out

Reply

Author ipreuss
Full name Ilja Preuß
Date 2003-07-15 07:17:46 PDT
Message Bob dot Tarling at irishlife dot ie wrote:
> To refactor
> System.out.println(???)
>
> to
> if (cat.isDebugEnabled()) cat.debug(???)
>
> (together with the declaration of the cat logger)
>
> seems like it must be a fairly common task. I wonder if there
> are any tools out there to do this for us? I'll have a look and
> report back.

If we wanted to go very simplistic, we could define an interface

interface Logger {
  void log(String message);
}

And replace

  System.out.println("...");

By

  Logging.getLogger().log("...");

A simle regex-replace tool should work.

It would be the responsibility of the Logger implementation to decide
wether to print the message to System.out, delegate to a more
sophisticated logging framework or just ignore it.

Regards, Ilja


--------------------​--------------------​--------------------​---------
To unsubscribe, e-mail: users-unsubscribe@ge​f.tigris.org
For additional commands, e-mail: users-help at gef dot tigris dot org

« Previous message in topic | 2 of 2 | Next message in topic »

Messages

Show all messages in topic

RE: [gef-users] System.out Bob dot Tarling at irishlife dot ie Bob dot Tarling at irishlife dot ie 2003-07-14 08:13:52 PDT
     RE: [gef-users] System.out ipreuss Ilja Preuß 2003-07-15 07:17:46 PDT
Messages per page: