colcon / colcon-core

Command line tool to build sets of software packages
http://colcon.readthedocs.io
Apache License 2.0
103 stars 46 forks source link

Missing option to specify log path #555

Closed bi3ri closed 1 year ago

bi3ri commented 1 year ago

Hello!

there are several options to specify base, install, and build path, but for logs it is missing.

colcon build \
      --base-paths ereal_ws/src \
      --install-base ereal_ws/install \
      --build-base ereal_ws/build \
      --log-base ereal_ws/log \

It seems there was a plan to add this feature though, because the command above results in the following output.

usage: colcon [-h] [--log-base LOG_BASE] [--log-level LOG_LEVEL] {build,clean,extension-points,extensions,graph,info,list,metadata,mixin,test,test-result,version-check} ...
colcon: error: unrecognized arguments: --log-base ...

Thanks! Johannes

cottsay commented 1 year ago

Hi, because the log --log-base option affects colcon before it even parses the verb, that particular option needs to be passed before the verb, as it is shown in the example you posted. This should work how you expect:

colcon --log-base ereal_ws/log build \
      --base-paths ereal_ws/src \
      --install-base ereal_ws/install \
      --build-base ereal_ws/build \
bi3ri commented 1 year ago

Thanks @cottsay!

  --log-base LOG_BASE   The base path for all log directories (default: ./log, to
                        disable: /dev/null)

That option specifies the default log path though. I was searching for an option to define the log path for each build separately.

Okay, I did misunderstand the documentation. The log path is specified for each build separately.