Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

log filename including compiler, version, linker and debug or release ?

<< < (4/7) > >>

pabristow:
Sorry - I was expecting info and link about it, as before.

I now have four copy files

hello_exceptions_build_log_Debug_clang900_2019-10-29-14.32_llvm_clang_900_compiler.html

which looks very promising.

But now have clearly messed something else because now the variables are not expanding :-(



with prebuild


--- Code: ---[[Log(_("Logging $(PROJECT_NAME) to Code::blocks log."))]]
--- End code ---


and post build


--- Code: ---[[Log(_("$(PROJECTNAME)_build_log_") + GetProjectManager().GetActiveProject().GetCurrentlyCompilingTarget().GetTitle() + _("_") + GetProjectManager().GetActiveProject().GetCurrentlyCompilingTarget().GetCompilerID() + _(".html"))]]

--- End code ---
the Codeblocks log says



--- Code: ---Logging $(PROJECT_NAME) to Code::blocks log.
$(PROJECTNAME)_build_log_Debug_clang900_llvm_clang_900_compiler.html

--- End code ---

and attempts to $NOW$ similar do not expand as expected ???

Sorry to be fumbling so much with this.


BlueHazzard:
Sorry, i forget to explain:

The file functions do replace the variables automatically. The Log function not. (see: The NOTE at http://wiki.codeblocks.org/index.php/Scripting_commands#IO_namespace )
If you want to replace the Variables in the Log output you have to run it trough

--- Code: ---ReplaceMacros()
--- End code ---
so

--- Code: ---Log(ReplaceMacros(_("Logging $(PROJECT_NAME) to Code::blocks log.")))
--- End code ---
should work as expected....

More information here: http://wiki.codeblocks.org/index.php/Scripting_commands

pabristow:
Prebuild

--- Code: ---[[Log(_("Logging $(PROJECT_NAME) to Code::blocks log."))]]
[[Log(ReplaceMacros(_("Logging $(PROJECT_NAME) to Code::blocks log.")))]]

--- End code ---

postbuild
[[IO.CopyFile(_("$(PROJECTNAME)_build_log.html"), _("$(PROJECTNAME)_build_log_") + GetProjectManager().GetActiveProject().GetCurrentlyCompilingTarget().GetTitle() + _("_$(NOW)_") + GetProjectManager().GetActiveProject().GetCurrentlyCompilingTarget().GetCompilerID() + _(".html"), true );]]


gives this


--- Code: ---Rebuild project:4
Logging $(PROJECT_NAME) to Code::blocks log.
Logging hello_exceptions to Code::blocks log.
$(PROJECTNAME)_build_log_Debug_clang900_llvm_clang_900_compiler.html


--- End code ---

So your advice is correct.

But I seemed to have stopped it expanding the file copy too?

and I am now not getting any log files from using any of the previous suggested postbuild commands :-(

(If i have NO postbuild, I get the expected html log file where I expect it).

What have I done to mess this up?

BlueHazzard:
Can you post the project file?
With your description it is quite hard to tell...
Maybe the log file gets copied somewhere you are not expecting? Have you tried to search for the file?

If you have only the described steps, why is there this output :

--- Code: ---$(PROJECTNAME)_build_log_Debug_clang900_llvm_clang_900_compiler.html
--- End code ---
This can not come from

--- Code: ---[[Log(_("Logging $(PROJECT_NAME) to Code::blocks log."))]]
[[Log(ReplaceMacros(_("Logging $(PROJECT_NAME) to Code::blocks log.")))]]
--- End code ---
or

--- Code: ---[[IO.CopyFile(_("$(PROJECTNAME)_build_log.html"), _("$(PROJECTNAME)_build_log_") + GetProjectManager().GetActiveProject().GetCurrentlyCompilingTarget().GetTitle() + _("_$(NOW)_") + GetProjectManager().GetActiveProject().GetCurrentlyCompilingTarget().GetCompilerID() + _(".html"), true );]]
--- End code ---
so maybe you have a log to much somewhere?

pabristow:
If I have no pre or post build, I get one file where I expect it

Build log saved as:
file://I:/Cpp/hello_boost/hello_exceptions/hello_exceptions_build_log.html

If I add


--- Code: ---[[IO.CopyFile(_("$(PROJECTNAME)_build_log.html"), _("$(PROJECTNAME)_build_log_") + GetProjectManager().GetActiveProject().GetCurrentlyCompilingTarget().GetTitle() + _("_$(NOW)_") + GetProjectManager().GetActiveProject().GetCurrentlyCompilingTarget().GetCompilerID() + _(".html"), true );]]
--- End code ---

and rebuild project

I get messages

Running target post-build steps in Build log
Rebuild project:4 in Code::blocks log



The copyfile doesn't seem to do anything.  Have I lost the permission setting?  (I have all the boxes ticked in the Settings, Script settings, Security.

Attached source and .cbp project as .7z.





Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version