Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » How to redirect LLOG to stderr?
How to redirect LLOG to stderr? [message #30886] Thu, 27 January 2011 17:37 Go to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
With Xcode and its debugger I cant use LLOG. Maybe someone knows how to redirect LLOG to stderr?
Re: How to redirect LLOG to stderr? [message #30910 is a reply to message #30886] Fri, 28 January 2011 10:25 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
First of all, I hope you are aware that LLOG is a very simple trick to limit LOG for single file. Where LLOG is used, there is usually a line

#define LLOG(x) // LOG(x)

at the start of file. Remove "//" and you get logging for that specific file.

(There are also some other L* macros in some files, but LLOG is the most prevalent).

Now to the question, you can redirect U++ standard log to stderr:

SetStdLog(LOG_CERR);


There are more options: LOG_FILE, LOG_COUT, LOG_CERR, LOG_DBG, LOG_TIMESTAMP and they can be used simultaneouslu (but LOG_DBG only works in Win32, in POSIX it is the same as LOG_CERR).

Standard setting is LOG_FILE. BTW, I wonder why it does not work for you - IMO it is the least requiring.

Mirek
Re: How to redirect LLOG to stderr? [message #30919 is a reply to message #30910] Fri, 28 January 2011 12:12 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
mirek wrote on Fri, 28 January 2011 09:25

First of all, I hope you are aware that LLOG is a very simple trick to limit LOG for single file. Where LLOG is used, there is usually a line

#define LLOG(x) // LOG(x)

at the start of file. Remove "//" and you get logging for that specific file.

(There are also some other L* macros in some files, but LLOG is the most prevalent).



from 2005. Smile


Quote:

Now to the question, you can redirect U++ standard log to stderr:

SetStdLog(LOG_CERR);



This is a brilliant answer!
But if you had named it eg SetStdLog(LOG_Cstderr), I would have found it...


Quote:

Standard setting is LOG_FILE. BTW, I wonder why it does not work for you - IMO it is the least requiring.


The reasons:
1. Xcode debugger console gives output from stderr.
2. I haven't found yet what to change in Core to have file streams working with Cocoa and friends.
3. We don't have theIde working properly with OSX X11 yet.
please answer this bug
4. I want logs displayed as soon as I click some Ctrls and not after 3 sec delay in Mac OS logs console. (On windows and linux I used theIde editor and it was updating more or less in real time).
Re: How to redirect LLOG to stderr? [message #30920 is a reply to message #30919] Fri, 28 January 2011 12:18 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
fudadmin wrote on Fri, 28 January 2011 06:12


2. I haven't found yet what to change in Core to have file streams working with Cocoa and friends.



Filestreams are POSIX - no need to use Apple APIs, just POSIX ones, which is already there...
Re: How to redirect LLOG to stderr? [message #30921 is a reply to message #30920] Fri, 28 January 2011 12:32 Go to previous message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
mirek wrote on Fri, 28 January 2011 11:18

fudadmin wrote on Fri, 28 January 2011 06:12


2. I haven't found yet what to change in Core to have file streams working with Cocoa and friends.



Filestreams are POSIX - no need to use Apple APIs, just POSIX ones, which is already there...



Yes, I know. But something is still wrong. I'll try to find out in the nearest future.
Previous Topic: virtual void Ctrl::PaintOver(Draw& w) new method
Next Topic: Assertion failed....
Goto Forum:
  


Current Time: Thu Mar 28 11:08:02 CET 2024

Total time taken to generate the page: 0.02192 seconds