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 » Developing U++ » UppHub » LogCtrl, a LOG/RLOG redirector to a DocEdit
LogCtrl, a LOG/RLOG redirector to a DocEdit [message #30724] Tue, 18 January 2011 17:57 Go to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
hi all

the Logging facility in upp is quite cool, and even has the ability to be redirected to any Stream. so why waste it only for debugging?

many applications have kind of logging in the background, and making it appear to review is handy, for expert users i.e. or for apps where logging is actually a vivid component, i.e. surveillance stuff..

so here comes a DocEdit Ctrl that can be placed somewhere in your app, and when it starts operation it redirects everything that RLOG/LOG and the others do. so no need to memorize anything new.
when it stops operation, it restores previous Stream. so it's kind of an interceptor.

for more grained things, there is LogLev(), definition of logging levels, and things like WARN("bla" << "other") and INFO("info stuff: " << myint) respect it.

it's quite simple but i think yet powerfull.

if any interest, i can put it in bazaar. any suggestions meanwhile are welcome



  • Attachment: LogCtrl.rar
    (Size: 2.67KB, Downloaded 298 times)

[Updated on: Tue, 18 January 2011 18:00]

Report message to a moderator

Re: LogCtrl, a LOG/RLOG redirector to a DocEdit [message #30813 is a reply to message #30724] Mon, 24 January 2011 09:38 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

See RLOG and RDUMP. It not only for debugging.

SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: LogCtrl, a LOG/RLOG redirector to a DocEdit [message #30819 is a reply to message #30813] Mon, 24 January 2011 10:13 Go to previous messageGo to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
yes i know Smile

but to have a log file is sometimes wasted lpower, some apps really can benefit from a live logging window inside.
Re: LogCtrl, a LOG/RLOG redirector to a DocEdit [message #30852 is a reply to message #30819] Tue, 25 January 2011 09:40 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3354
Registered: August 2008
Senior Veteran
Sorry Konstantin

Compiling the package in Windows in LogCtrl.h file, line:

DocEdit::Style st;


compiler says:

'Style' : is not a member of 'Upp::DocEdit'


Best regards
Iñaki
Re: LogCtrl, a LOG/RLOG redirector to a DocEdit [message #30854 is a reply to message #30852] Tue, 25 January 2011 10:08 Go to previous messageGo to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
sorry, forgot about that, got some changes in the svn tree which are not due in upstream. mirek needs to give an ok on that.

just comment the things concerning style, DocEdit::Style and in the ctor the 3 lines and it should do..

EDIT: it's far from beeing state of finish, but as a starter, ready to implement some more ideas..

i.e implement some filters, respect EOF etc

[Updated on: Tue, 25 January 2011 10:24]

Report message to a moderator

Re: LogCtrl, a LOG/RLOG redirector to a DocEdit [message #31130 is a reply to message #30854] Mon, 07 February 2011 10:03 Go to previous messageGo to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
what about redirecting printf's as well? meaning stdout and stderr?

i've looked at how it's done, it's not hard in terms of code, but not easy in terms of handling. redirecting is done to a pipe, but the pipe can be full, because not fast enough reading from it and posting to, let's say to the console window, so the printf blocks.

this also would make it impossible to be properly 'inlined' in chronological manner with RLOGs.., since it's buffered with both pipe and the Stream writing to Std Log Stream..

any ideas / comments anyway?
Re: LogCtrl, a LOG/RLOG redirector to a DocEdit [message #31741 is a reply to message #31130] Wed, 23 March 2011 11:23 Go to previous messageGo to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
i spent some thought on it, and, stdin/stdout/stderr are means of piping things through applicatoins.

properly designed stuff shouldnt be needing this to appear in a log window, since it might be stuff meant for another program..

so redirecting LOG is just enough.

any one want to see it in bazaar?
Re: LogCtrl, a LOG/RLOG redirector to a DocEdit [message #31852 is a reply to message #31741] Thu, 31 March 2011 10:22 Go to previous messageGo to next message
chickenk is currently offline  chickenk
Messages: 169
Registered: May 2007
Location: Grenoble, France
Experienced Member
kohait00 wrote on Wed, 23 March 2011 11:23

any one want to see it in bazaar?


Well, since PyCon is in bazaar now and needs LogCtrl to compile, I think that would be a good idea to include it indeed.

Lionel
Re: LogCtrl, a LOG/RLOG redirector to a DocEdit [message #31854 is a reply to message #31852] Thu, 31 March 2011 10:24 Go to previous messageGo to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
soorry, damn forgot it Smile
EDIT: just uploaded to svn..
but since it's not up in mirror yet...
  • Attachment: LogCtrl.rar
    (Size: 7.56KB, Downloaded 287 times)

[Updated on: Thu, 31 March 2011 10:29]

Report message to a moderator

Re: LogCtrl, a LOG/RLOG redirector to a DocEdit [message #31857 is a reply to message #31854] Thu, 31 March 2011 10:51 Go to previous messageGo to next message
chickenk is currently offline  chickenk
Messages: 169
Registered: May 2007
Location: Grenoble, France
Experienced Member
thanks, another note: it seems the control is called LoggerCtrl in PyConsoleCtrl.h. Renaming it to LogCtrl seems to do the trick. I'm gonna make a try with your new archive Smile

Lionel
Re: LogCtrl, a LOG/RLOG redirector to a DocEdit [message #31858 is a reply to message #31857] Thu, 31 March 2011 11:18 Go to previous message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
LoggerCtrl has been split away from LogCtrl, beeing now a multipurpose DocEdit with a Stream interface. this is in the new sources..

take the new copy..
Previous Topic: New video and web browser activex controls for windows
Next Topic: PythonPP - tiny C++ wrappers for Python C API
Goto Forum:
  


Current Time: Thu Mar 28 10:19:57 CET 2024

Total time taken to generate the page: 0.01653 seconds