News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Retrieve all build messages

Started by threeS, September 29, 2014, 03:32:27 AM

Previous topic - Next topic

threeS

Good day to all!

I am now doing a plugin that connects to the database every time the codeblocks compiles(thanks to you all for the previous questions). Using the code below:

Manager::Get()->RegisterEventSink(cbEVT_COMPILER_STARTED, new cbEventFunctor<PluginName,CodeBlocksEvent>(this,&PluginName::OnCompileStart));
Manager::Get()->RegisterEventSink(cbEVT_COMPILER_STARTED, new cbEventFunctor<PluginName,CodeBlocksEvent>(this,&PluginName::OnCompileEnd));

Now I want to get all the messages generated in the "Build messages" tab can you help me in this problem guys?

CodeBlocks Build Number: 9851
OS: Ubuntu 14.04 64 bit

Thanks in advance!  ;D

Alpha

I recommend digging around in C::B for the relevant API calls.  The following files should be a good starting place:
include/logmanager.h
include/logger.h
include/loggers.h
plugins/compilergcc/compilermessages.h

threeS

I've been digging the codes that you suggested but I realized that it becomes a little bit tricky I guess when it comes to how will I get the instance of the Logger/Loggers/CompilerMessages classes that the compiler class uses when compiling, because if I will create a new instance then it is useless I guess.

??? ::)

stahta01

No idea; but, maybe looking at the code the saves the Build log as HTML would be an option.

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]

Alpha

Hmm, yes, API does not look too friendly for this.  You could try LogManager->Slot(int i)->[title: check name; GetLogger()]->typecastAndHope.

MortenMacFly

Quote from: Alpha on September 30, 2014, 05:46:38 AM
Hmm, yes, API does not look too friendly for this.  You could try LogManager->Slot(int i)->[title: check name; GetLogger()]->typecastAndHope.
You (threeS) could introduce a new API and provide us with a patch...
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]

threeS

#6
Yes we will be happy if we could help the codeblocks community by this. Me and my friend(forum name, kugtong33) will be glad to help but we use git and we found in the wiki on how to contribute using git but is it ok with you guys if we setup a mirrored repository in github? And one more thing, since this is a homework as i stated I might first figure out how to get those build messages. :D

Thanks for the replies.

ollydbg

Quote from: threeS on September 30, 2014, 01:27:12 PM
Yes we will be happy if we could help the codeblocks community by this. Me and my friend(forum name, kugtong33) will be glad to help but we use git and we found in the wiki on how to contribute using git but is it ok with you guys if we setup a mirrored repository in github?
It's OK to mirror the repo in github, why not?  :)
I also use git and git-svn.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Jenna

There are already several codeblocks mirrors on github.
One is mine in https://github.com/jenslody, but that is not always uptodate, because I need to manual push it from my own server.
In https://cgit.jenslody.de/codeblocks/ I have a git-clone of the codeblocks svn-repo that is updated every 20 minutes.

ollydbg

Quote from: jens on September 30, 2014, 03:46:35 PM
...
In https://cgit.jenslody.de/codeblocks/ I have a git-clone of the codeblocks svn-repo that is updated every 20 minutes.
Hi, jens, does the above address allow user to clone it? (I have tried, but failed)
Or it is a web interface? Thanks.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

stahta01

I found the Mirror by biplab to be the easiest to clone and work with; but, that might just be the fact I tried it last. (I am hoping that I am getting better with Git with time.)

    Git URL: git://cb.biplab.in/codeblocks.git

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]

Jenna

Quote from: ollydbg on September 30, 2014, 03:51:30 PM
Quote from: jens on September 30, 2014, 03:46:35 PM
...
In https://cgit.jenslody.de/codeblocks/ I have a git-clone of the codeblocks svn-repo that is updated every 20 minutes.
Hi, jens, does the above address allow user to clone it? (I have tried, but failed)
Or it is a web interface? Thanks.
Sorry, yes it's the webinterface.
You should be able to clone the repos with :
Quotegit clone git://jenslody.de/git/codeblocks
Quotegit clone git://jenslody.de/git/wxWidgets
Quotegit clone git://jenslody.de/git/gnome-shell-extension-openweather
Quotegit clone git://jenslody.de/git/gnome-shell-extension-panel-osd

I also corrected the clone-url shown by cgit.

kugtong33

Creating an organization(like codeblocks, codeblocks.sourceforge, etc.) in the github and put all the repositories in one place(in the organization) might be a better idea and this makes it a lot easier for others to find it.

;D

stahta01

Quote from: kugtong33 on September 30, 2014, 10:36:09 PM
Creating an organization(like codeblocks, codeblocks.sourceforge, etc.) in the github and put all the repositories in one place(in the organization) might be a better idea and this makes it a lot easier for others to find it.

;D

I take it you are NOT a Git user, correct?

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]

threeS

If the community don't want it that way, well there is no problem.