Jump to content

Logging ?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
5 replies to this topic

#1
Victor

Victor

    Programmer

  • Members
  • PipPipPipPip
  • 116 posts
Is there a way to log System.out and System.err to a text file w/o redirecting, i.e. the console and the file would match?

Thanks in advance

#2
marwex89

marwex89

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 10,720 posts
It might be some trick you can use that I'm not aware about....

I would write my own function for e.g. System.out which use System.out like normal, but also logs the information like you want it.

That's just my way :D
Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

#3
Victor

Victor

    Programmer

  • Members
  • PipPipPipPip
  • 116 posts
I thought about something like that, but it's a complex program with several classes that use System.out alot. I'd hate to do something time consuming when a simple function could be used. I'm able to log to a file the System.out and System.err, but it redirects the traffic

#4
marwex89

marwex89

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 10,720 posts
I mean a function like:

Declaring func "OutEx" (params)
System.out (params)
[log here] (params)

And then just replace everywhere you use System.Out.

If this doesn't work for you, I'm not sure..... Maybe ask someone else :D
Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

#5
Victor

Victor

    Programmer

  • Members
  • PipPipPipPip
  • 116 posts
I understood what you were talking about, and if nothing better is suggested I will just have to do that.

#6
marwex89

marwex89

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 10,720 posts
Patience, son, patience :D
Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa