Author Topic: Log output to CB console  (Read 5031 times)

Offline tigerbeard

  • Almost regular
  • **
  • Posts: 186
Log output to CB console
« on: April 03, 2016, 11:15:42 pm »
This topic has been started before but I did not see a useful completion. Threads are e.g.
http://forums.codeblocks.org/index.php/topic,13175.msg88504.html#msg88504
http://forums.codeblocks.org/index.php/topic,17413.msg119538.html#msg119538

Basically this describes what I was looking for.

[Quote from: MortenMacFly on August 25, 2010, 07:12:47 am]
Quote
    Is there a way to display the printed output from a console application in a text area in the codeblocks IDE?
You can use the "Tools" menu to create an entry that calls your application (using macros to make it more generic) and then pipe the output to the C::B log.
[/Quote]

Since the original thread is locked please allow me here to come back to it.
I actually tried out that proposal and met some issues. Here is what I did.

Code
Tools/Configure/Add
 Name: Run and send cout to CodeBlocks Tab
 Exec: $(TARGET_OUTPUT_BASENAME)
 Params: empty
 WorkingDir: $(TARGET_PROJECT_DIR)
 LaunchOptions: LaunchTool hidden with standard output redirected
Now I have a new menu entry: Tools/Run and send cout to CodeBlocks Tab. When I open the menu and select the new enty, my Application starts and I see its log outputs in the console window. Wonderful!

Unfortunately there are some issues:
 - I could not set up my execution directory, at least I do not know what Macro to use. How can I find out
   wether or not there is a macro for that?

 - After I tried to set it manually I kind of corruped it. Despite C::B restart and removing and adding it again I can not
  get it to run any more. I observe in the Edit Tool window, that all macro names are missing their "_", i.e.
  $(PROJECT_OUTPUT_BASENAME) now is listed as $(PROJECTOUTPUTBASENAME). Neither works any more.
  I get the error message "Couldn't execute tool. Check out the log for details."
  I tried Tools+/ToolOutputWindow, CodeBlocks console, Project directory and CodeBlocks directory but could not find a log.
  The console gives me just the info launching tool...

 - I could assing a hotkey to it, e.g. F6 which is not assigned as default. With thats its rather good to use. Using the
  menu only would imho not an acceptable usability for such a frequently used command.

 - I can not see a way implement "Build and Run" with that
 - I can not see a way implement "Abort" with that,  as we do not have the PID
 - I can not see a way to get the Run button assigned that function.
 - Any way to start debug with output

So principally technically easy to do and highly recommended to use, if
 - the Project exec dir is available
 - there is a workaround for that issue that broke it for me..

I am wondering what was the rationale not to provide this as build in behaviour of Run/Build&Run and Debug? 

« Last Edit: April 04, 2016, 12:08:31 am by tigerbeard »

Offline uart

  • Single posting newcomer
  • *
  • Posts: 2
Codeblocks stuck on load screen: It Won't load up - Windows 10
« Reply #1 on: July 13, 2016, 02:55:56 pm »
I couldn't post new for some reason.

Codeblocks v16.01 won't start under Windows 10 (go figure).
Currently:

Microsoft Windows [Version 10.0.10586]
Intel i5-3330 @3GHz, 6GB, Ram, 64-bit OS
Intel HD Graphics, OpenCL
Update  KB3116278
Update  KB3135173
Update  KB3136561
Update  KB3140741
Update  KB3149135
Update  KB3167685
Update  KB3163018

I have a dumpfile.dmp (224MB) if useful.

**UPDATE**
But after:
-Coming to this forum, Registering, activating my uart account, building this list and previewing this message NOW it works.

Here's what I done:
-Closed out everything & rebooted
-Closed out everything again
-Used cleanmgr to delete everything deletable
-Deleted Windows logs via devmgmt.msc
-Deleted C:\%USERPROFILE%\AppData\Local\Temp (because cleanmgr failed so epicly .-. )
-Go to Codeblocks.org & fill out an account, making sure the$ofts sees your cookies there, getting ready to post (optional step)
-Restarted Code::Blocks and it WORKED :)
(Pf.Windows big10... wow.)

Hope this helps.