News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

New log manager since rev. 4606

Started by mandrav, November 10, 2007, 02:16:45 PM

Previous topic - Next topic

mandrav

Hi all.

Revision 4606 brings you the new shiny LogManager to handle all logging needs. Say bye-bye to MessageManager :).

The most important reason for this change was that it separates the logging from the GUI. If you want to add a logger to the GUI you explicitly do this by sending the (new) cbEVT_ADD_LOG_WINDOW message.

The functions you are used to already are present in the new system: Log(), DebugLog(), LogWarning(), LogError() and friends.
The major difference is that they accept two arguments: a wxString (the message to log) and a LogManager::level (the logging level).
If you want to format a string (like the old functions accepted), use the F function (keep keystrokes to a minimum ;)). Something like: Manager::Get()->GetLogManager()->Log(F(_T("%d"), 5));

All code in our repository (including contrib plugins) has been accordingly updated (hopefully without mistakes :P). It's been tested for a couple of days and seems to work fine. Of course, if any problems pop up they will be dealt as appropriate.

The resume of the above is: everything is converted and works like it used to.
To learn more about the new system, see sdk_event.h for the new logging events, logmanager.h for the new manager, logger.h for the loggers interface and loggers.h/cpp for the implementation of the standard built-in loggers.

External plugin developers hopefully now know what to expect/fix when they update their working copy of Code::Blocks :).
For any questions/suggestions, just come forth and ask.
Be patient!
This bug will be fixed soon...

Howard

Windows get the following compile errors:

mingw32-g++.exe: .objs\sdk\messagelog.o: No such file or directory
mingw32-g++.exe: .objs\sdk\messagemanager.o: No such file or directory
mingw32-g++.exe: .objs\sdk\simplelistlog.o: No such file or directory
mingw32-g++.exe: .objs\sdk\simpletextlog.o: No such file or directory
Process terminated with status 1 (3 minutes, 23 seconds)
0 errors, 0 warnings


Jenna

Quote from: Howard on November 10, 2007, 03:40:01 PM
Windows get the following compile errors:

mingw32-g++.exe: .objs\sdk\messagelog.o: No such file or directory
mingw32-g++.exe: .objs\sdk\messagemanager.o: No such file or directory
mingw32-g++.exe: .objs\sdk\simplelistlog.o: No such file or directory
mingw32-g++.exe: .objs\sdk\simpletextlog.o: No such file or directory
Process terminated with status 1 (3 minutes, 23 seconds)
0 errors, 0 warnings


The according .cpp-files are missing from svn-tree.

killerbot

nonono; these were still in the windows cbp file, fixed now ;-)

killerbot

#4
note on windows there are still other issues, our don is a linux guy ;-)

EDIT : working on fixing them ...
EDIT : while getting there, my linux build builds ok, but after showing the splash screen the story ends ...
EDIT : windows build fine now , but also crash  (in debugger.dll)

mandrav

Quotenonono; these were still in the windows cbp file, fixed now
Ah, yes, I knew I forgot something :).

Be patient!
This bug will be fixed soon...

killerbot

and debugger plug-in crash is also solved

MortenMacFly

Noticed a crash with he TODO plugin. If you enable to show the plugin in the message panel C::B will crash on startup.

BTW: I'm still in the progress of further removing any links to messagemanager e.g. inside commented code). Will commit possibly tomorrow. ;-)

With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Jan van den Borst

In the old days warnings showed up blue and errors red in the Build messages and Build log tabs. This is not happening anymore in svn4616. Also the codeblocks config file (default.conf) is incompatible with older versions as the editor disappears in SVN 4616 and is only showed again after deleting the config file.

Jan

killerbot

QuoteIn the old days warnings showed up blue and errors red in the Build messages and Build log tabs.

I can confirm this.
And I also have no longer the codeblocks app log in the messages panel at the bottom; though on linux it is still there.

@Thomas: I think your the guy who can solve this ;-)

In my case no editor disapeared but it have another strange thing, see here : http://forums.next.codeblocks.org/index.php?topic=7258.msg55406;topicseen#new

stahta01

Is there a replacement for simpletextlog.h/class SimpleTextLog?

Some plugins like SVNInside use it.

Tim S
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

stahta01

Quote from: MortenMacFly on November 11, 2007, 07:44:34 PM
Noticed a crash with he TODO plugin. If you enable to show the plugin in the message panel C::B will crash on startup.

BTW: I'm still in the progress of further removing any links to messagemanager e.g. inside commented code). Will commit possibly tomorrow. ;-)

With regards, Morten.

I suggest looking at sdk/config-testsuite.cpp

Tim S
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

mandrav

Quote from: Jan van den Borst on November 11, 2007, 09:41:58 PM
In the old days warnings showed up blue and errors red in the Build messages and Build log tabs. This is not happening anymore in svn4616.

Strange, that's working fine here (linux).

Quote from: Jan van den Borst on November 11, 2007, 09:41:58 PM
Also the codeblocks config file (default.conf) is incompatible with older versions as the editor disappears in SVN 4616 and is only showed again after deleting the config file.

Jan

This can happen from time to time (when we do such a major change), but you don't have to delete your config file! Just "View->Layouts->Delete current" should be enough...

Quote from: stahta01 on November 11, 2007, 11:41:42 PM
Is there a replacement for simpletextlog.h/class SimpleTextLog?

Some plugins like SVNInside use it.

Tim S

In loggers.h, among others you will find TextCtrlLogger.
Be patient!
This bug will be fixed soon...

thomas

Quote from: mandrav on November 12, 2007, 09:03:43 AM
Quote from: Jan van den Borst on November 11, 2007, 09:41:58 PM
In the old days warnings showed up blue and errors red in the Build messages and Build log tabs. This is not happening anymore in svn4616.
Strange, that's working fine here (linux).
Happens here too, though. I assume it is because you don't use the LogManger consequently in the compiler plugin. There is this one function that does some awful tampering with a lot of if()s and stuff to either log something or not, and to write out some HTML to a file.
Don't worry, though. That's easily fixed, and it's not a severe thing, either. I planned a small update to FileLogger anyway, can add a FileLogger that ouputs HTML too then, which should fix the problem. Just don't have time to do anything today, so will be tomorrow.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

MortenMacFly

Quote from: MortenMacFly on November 11, 2007, 07:44:34 PM
Noticed a crash with he TODO plugin. If you enable to show the plugin in the message panel C::B will crash on startup.
Very strange: Here at work it just works. No crash at all...?!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]