Author Topic: log filename including compiler, version, linker and debug or release ?  (Read 28277 times)

Offline pabristow

  • Multiple posting newcomer
  • *
  • Posts: 75
Re: log filename including compiler, version, linker and debug or release ?
« Reply #30 on: November 05, 2019, 01:01:57 pm »
:) Works for me.

8)

Would be nice not to have to provide the CMD /C(easily forgotten), but works.

Screen snips attached.  One just shows the (copy) filename generated, the other a diff from the original log file with 'standard' file name.

Thanks.  Sorry this was such a marathon.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: log filename including compiler, version, linker and debug or release ?
« Reply #31 on: November 05, 2019, 01:37:29 pm »
Be carefull! The copy is the log from the previous build, not from the current build!!!!

I have a plan to solve this and will provide a patch for review for the other devs in the next days.

Offline Thoth

  • Multiple posting newcomer
  • *
  • Posts: 18
Hi Everyone,

I am using CodeBlocks 20.03 on Debian 10 and FreeBSD 12.

When I use the Squirrel command in the post-build step, no change is made to the name of the build log file.
Code
[[IO.CopyFile(_("$(PROJECTNAME)_build_log.html"), _("$(PROJECTNAME)_build_log_") + GetProjectManager().GetActiveProject().GetCurrentlyCompilingTarget().GetTitle() + _("_$(TDAY)_") + GetProjectManager().GetActiveProject().GetCurrentlyCompilingTarget().GetCompilerID() + _(".html"), true );]]
CMD /C

I believe it is because my $(PROJECT_NAME) is "LPO LogIt" and the name of the build log is lpo_log_it_build_log.html.
Code
I am guessing that 
CopyFile(_("$(PROJECTNAME)_build_log.html")
results in
CopyFile(_("LPO LogIt_build_log.html")
Is this correct?

Also, I am guessing that the log file creation functionality uses the Code::Blocks project file name as a fallback.

How can I access the actual name of the generated log file so that I can rename it to include the date and perhaps process it with html2text?

FYI, No log file is created without the trailing "CMD /C" which generates an error on both systems.


=thoth=

« Last Edit: July 17, 2022, 10:50:54 pm by Thoth »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Quote
FYI, No log file is created without the trailing "CMD /C" which generates an error on both systems.
obvisouly, because this is windows only

The build log file is named like this:
Code
basename = wxFileName(m_pProject->GetFilename()).GetName();
basepath = m_pProject->GetBasePath();
....
m_BuildLogFilename = basepath;
m_BuildLogFilename << basename << _T("_build_log.html");

if i look at the macromanager code, that handles the replacing of the files i can see that
Code
PROJECTFILE
should be the same name

the of you used "PROJECTNAME" is the name of the project, that has not to be the same as the project file name