   C++ create or integrate a logging system
  I'm developing a project using Ogre, CEGUI and boost with VC++ 2008. The project is still on an early stage, and I want to implement or integrate a logging system.I like the way Thermite3d implemented their logging system, they use Qt library for such purpose.Some of the features I want to have: Different tabs for each log category Possible to add or remove different categories on the same tab during run time Write commands (change the logging "level" for certain category would be the most important) Extent and format data (struct, classes) Filter searching for a keyword Logging in files (maybe not relevant since it will be really easy having the rest)Qt has some of these features, it is a huge library which is also aimed for UI purposes. But before considering this heavy library I would like to take a look for some other options. One using boost would be the best IMO, the less heavy the best....   
  What you're looking for is essentially a log UI. Boost doesn't do UI. In fact, it doesn't even do logging (apart from Boost.Log which recently underwent formal review).If you already have CEGUI integrated in your project, can't you just write a lightweight log library and CEGUI log capture components?EDIT: By the way, in what sense is boost not "heavy"? :)   ;  I got sick of sifting through heavy logging frameworks. I wrote a tiny logging library that you can pretty much bend any which-way you want. You might like it. No GUI, though.Quote:Original post by WindryderEDIT: By the way, in what sense is boost not "heavy"? :)I'm guessing that itzjac is referring to the way in which it's much easier to integrate a small part of boost in to a code-base than it is a small part of Qt (anecdotally speaking).;  If you really must have such a complicated logging "view", why not write a HTML (or XHTML) page and maybe have it refresh automatically.I think with &#106avascript you can sort the log message categories. You know, it's just one big table which you can sort based on time, log category, and so on, whatever you put in the column header.For searching you would already have a web browser which can do that.I think you are in danger of over-engineering it. Are log files that interesting? My approach is to actually disable writing a log file unless a command-line parameter requests it to be written. Because, probably 99.99 % of the time, nobody is interested in the log file at all. It's a tool for when something goes wrong, which should not happen 99.99 % of the time but maybe it will happen 0.01 % of the time. This is a very important point - don't do a lot of work to implement a feature which is not needed at all most of the time the application is being used.   ;Quote:I think you are in danger of over-engineering it.Yea, I haven't wasted time implementing this... good advice and I was aware of this issue, my log is very simple by now.Quote:I wrote a tiny logging library that you can pretty much bend any which-way you want. You might like it. No GUI, though.Good, this one can be what I was asking, thanks!Quote:... than it is a small part of Qt (anecdotally speaking).Yea, I never mentioned boost was heavy or light.   ;  Note: I'm the author of the engine/logging system identified in the original post. For the uninitiated, this is the system we are talking about:It's important to differentiate between the logging framework (the functions which are called from your application) and the log viewer (the pretty user interface which performs filtering, etc). In my engine I haven't really done much logging - I've just redirected the logs from Ogre, Qt, etc into a nice user interface.If you want a logging framework then I have heard good things about Pantheios. There is also a logging frameworkfor Boost (not sure if it ever got accepted) and I'm sure other people can suggest other options.For the GUI you can use anything. I use Qt but most GUI toolkits should let you create a window with tabs and text boxes.Although a real time logging window has proved to be useful for debugging and developing my application, remember that's it's not so much use when the applications crashes :-) Also, there tends to be a delay when logging to this viewer because various windows messages need to be processed to update the display, and if the logging is happening accross threads then some syncronisation may need to be performed. This can mean the last few messages don't reach the GUI, so you'll want to write all messages to a standard log file as well.[Edited by - PolyVox on May 13, 2010 2:04:19 PM];Quote:Disclaimer: I'm the author of the engine/logging system identified in the original postHi, I hope this thread will also help to spread more you great work ;)Quote:If you want a logging framework then I have heard good things about Pantheios.Thank you. BTW, I didn't mean I won't consider the Qt way anymore.   