how to read back the lines printed out to the console?

L

Lew

Since ALL your messages come out at one level at the moment,
you can assign an arbitrary level (say INFO) in Log4j, and have
the same level of control you currently have (none), and fulfil
your "file" requirment. Refining the Log4j levels can be deferred
indefinitely, according to business requirments.

That's right, "frame", and it's interesting that although every single one of
your objections to using a logger has been answered, and we've shown that the
effort to make the change is FAR less than what you're doing, you have not
acknowledged the answers, paid attention to advice far more expert than your
own, or done the right thing.
 
A

Arne Vajhøj

People have already answered this question in detail, with code examples.

But what you really need to do is take the suggestion to use a logging
framework. Then you can change the configuration in a properties file
with no code changes. 500 instances isn't very many, especially with a
global 's/System.out.println/logger.info/'. Any decent IDE will let you
do that in a single pop.

Hmm.

PrintStream refs pointing to System.out, byte code only doing it ...

What IDE handle those?

Arne
 
A

Arne Vajhøj

This is still far harder, more fragile and less flexible that biting the
bullet and *using a logging framework*.

In your career you will have to learn when to do the right thing. Doing
the wrong thing, although you believe it now to be more expedient, will
inevitably bite you in the ass. Hopefully at that time you'll say to
yourself, "Well, Lew warned me this was going to happen. I should have
listened back then when it was only a simple matter of substituting text
in 500 locations instead of having to maintain this kludgey, buggy,
large subsystem."

I don't think setting out to an instance of a relative simple
class qualifies as "large subsystem".

If they have time, then converting to a logging framework is the
right solution.

If they do not have time, then setting out now and put switching
to a logging framework on the TODO list is the right solution.

We all know that this type of item can be on the TODO list
for years without being implemented, but sometimes the time
is just not there to do the right thing.

Arne
 
F

frame

L-E-W:

I bet you have smelled out who I am, even though I have switched my
user name. Let me get things straight here:

1)first, as far as I understand, this Java news group is a public news
group, not *your* private news group. I have the right to join and
post.

2)second, this is a *free* public list, since you have emphasized
before that I have got free answers. If you think I should be charged
for what I am getting here, change the rule of this news group and
make it clear upfront.

3)third, I am not demanding anybody -- including you definitely-- to
answer my questions: if somebody wants to answer, he is more than
welcome to; if he does not want to, that is totally fine.

What I have been done on this Java news group and other news groups
completely follow the rules.

4)This is for you only, please *do not* answer my post. I don't
appreciate any of your posts. To be honest, I have ignored almost all
of them. To me, you are a very old hand of Java, with very little of
understanding of it. Spend your "Java knowledge" somewhere else, ok?

If you have a job with health insurance, I advise you seek mental
health treatment. Killing your time on the internet does not cure your
problem. It makes it worse.
 
I

Ian Shef

L-E-W:

I bet you have smelled out who I am, even though I have switched my
user name. Let me get things straight here:

1)first, as far as I understand, this Java news group is a public news
group, not *your* private news group. I have the right to join and
post.

.... and so does Lew !
2)second, this is a *free* public list, since you have emphasized
before that I have got free answers. If you think I should be charged
for what I am getting here, change the rule of this news group and
make it clear upfront.
???

3)third, I am not demanding anybody -- including you definitely-- to
answer my questions: if somebody wants to answer, he is more than
welcome to; if he does not want to, that is totally fine.

What I have been done on this Java news group and other news groups
completely follow the rules.

4)This is for you only, please *do not* answer my post. I don't
appreciate any of your posts. To be honest, I have ignored almost all
of them. To me, you are a very old hand of Java, with very little of
understanding of it. Spend your "Java knowledge" somewhere else, ok?

Lew is free to post as he sees fit. He has tremendous knowledge and
experience with Java. By ignoring his attempts to help you, you are
ignoring a powerful resource. Too bad.

If you have a job with health insurance, I advise you seek mental
health treatment. Killing your time on the internet does not cure your
problem. It makes it worse.

Personal attacks are not helpful. This one is particularly unfair and out
of line.

You and Lew are both free to post. It would be helpful if the postings are
kept friendly, or at least professional. A good newsreader will allow you
to ignore Lew's postings, but you do so at your own "Java peril".
 
F

frame

Lew is free to post as he sees fit.  He has tremendous knowledge and
experience with Java.  By ignoring his attempts to help you, you are
ignoring a powerful resource.  Too bad.




Personal attacks are not helpful.  This one is particularly unfair and out
of line.

You and Lew are both free to post.  It would be helpful if the postingsare
kept friendly, or at least professional.  A good newsreader will allow you
to ignore Lew's postings, but you do so at your own "Java peril".

If the OP does not appreciate that person's posting and that person
just insist doing so, that must be some reason of "friendly", "at
least professional" or mental health problem.
 
G

Gene Wirchenko

[snip]
If the OP does not appreciate that person's posting and that person
just insist doing so, that must be some reason of "friendly", "at
least professional" or mental health problem.

I find Lew to be rather brash, but your attacks are over the top.

Sincerely,

Gene Wirchenko
 
A

Arne Vajhøj

L-E-W:

I bet you have smelled out who I am, even though I have switched my
user name.

I have not.
Let me get things straight here:

1)first, as far as I understand, this Java news group is a public news
group, not *your* private news group. I have the right to join and
post.
True.

2)second, this is a *free* public list, since you have emphasized
before that I have got free answers. If you think I should be charged
for what I am getting here, change the rule of this news group and
make it clear upfront.
True.

3)third, I am not demanding anybody -- including you definitely-- to
answer my questions: if somebody wants to answer, he is more than
welcome to; if he does not want to, that is totally fine.

What I have been done on this Java news group and other news groups
completely follow the rules.
True.

4)This is for you only, please *do not* answer my post. I don't
appreciate any of your posts. To be honest, I have ignored almost all
of them. To me, you are a very old hand of Java, with very little of
understanding of it. Spend your "Java knowledge" somewhere else, ok?

Try google for killfile.
If you have a job with health insurance, I advise you seek mental
health treatment. Killing your time on the internet does not cure your
problem. It makes it worse.

I think you should take your own advice.

Lew insisted that you should switch to a logging framework.

One can agree or disagree, but it is something that can
be argued.

Your post on the other hand is not good behavior.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top