Author Topic: Retrieve all build messages  (Read 9200 times)

Offline threeS

  • Multiple posting newcomer
  • *
  • Posts: 36
Retrieve all build messages
« on: September 29, 2014, 03:32:27 am »
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

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Retrieve all build messages
« Reply #1 on: September 29, 2014, 06:11:14 am »
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

Offline threeS

  • Multiple posting newcomer
  • *
  • Posts: 36
Re: Retrieve all build messages
« Reply #2 on: September 30, 2014, 03:46:39 am »
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.

 ??? ::)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7056
    • My Best Post
Re: Retrieve all build messages
« Reply #3 on: September 30, 2014, 04:17:00 am »
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++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Retrieve all build messages
« Reply #4 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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9609
Re: Retrieve all build messages
« Reply #5 on: September 30, 2014, 07:47:22 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: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline threeS

  • Multiple posting newcomer
  • *
  • Posts: 36
Re: Retrieve all build messages
« Reply #6 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? 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.
« Last Edit: September 30, 2014, 01:30:55 pm by threeS »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5295
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Retrieve all build messages
« Reply #7 on: September 30, 2014, 03:31:58 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.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Retrieve all build messages
« Reply #8 on: September 30, 2014, 03:46:35 pm »
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.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5295
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Retrieve all build messages
« Reply #9 on: September 30, 2014, 03:51:30 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.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7056
    • My Best Post
Re: Retrieve all build messages
« Reply #10 on: September 30, 2014, 03:57:05 pm »
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++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Retrieve all build messages
« Reply #11 on: September 30, 2014, 08:40:49 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 :
Quote
git clone git://jenslody.de/git/codeblocks
Quote
git clone git://jenslody.de/git/wxWidgets
Quote
git clone git://jenslody.de/git/gnome-shell-extension-openweather
Quote
git clone git://jenslody.de/git/gnome-shell-extension-panel-osd

I also corrected the clone-url shown by cgit.

Offline kugtong33

  • Single posting newcomer
  • *
  • Posts: 2
Re: Retrieve all build messages
« Reply #12 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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7056
    • My Best Post
Re: Retrieve all build messages
« Reply #13 on: September 30, 2014, 11:29:17 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++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline threeS

  • Multiple posting newcomer
  • *
  • Posts: 36
Re: Retrieve all build messages
« Reply #14 on: September 30, 2014, 11:59:04 pm »
If the community don't want it that way, well there is no problem.

Offline kugtong33

  • Single posting newcomer
  • *
  • Posts: 2
Re: Retrieve all build messages
« Reply #15 on: October 01, 2014, 12:03:58 am »
Average user I think  ???

Well I am just starting to know how the open source community works
 ;D

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Retrieve all build messages
« Reply #16 on: October 01, 2014, 12:11:56 am »
The official Code::Blocks repo is a subversion repo and is hosted at sourceforge: http://sourceforge.net/projects/codeblocks/ .

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5295
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Retrieve all build messages
« Reply #17 on: October 01, 2014, 05:11:43 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 :
Quote
git clone git://jenslody.de/git/codeblocks
Quote
git clone git://jenslody.de/git/wxWidgets
Quote
git clone git://jenslody.de/git/gnome-shell-extension-openweather
Quote
git clone git://jenslody.de/git/gnome-shell-extension-panel-osd

I also corrected the clone-url shown by cgit.
Thanks, this works fine. I also update our wiki Developer documentation - CodeBlocks
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.