Ask Your Question

How do I set the logging directory in Foxy?

asked 2020-07-21 21:06:55 -0600

dawonn_haval gravatar image

I would like to configure the log directory to be elsewhere in my file.

I found what appears to be the function that I need to call, but how?

edit retag flag offensive close merge delete



I'm not too sure how good an example this is, but the test for this feature might be useful?

KenYN gravatar image KenYN  ( 2020-07-22 03:37:27 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2020-08-01 15:33:58 -0600

dawonn_haval gravatar image

Thanks for the hint @KenYN!

import os
from datetime import datetime
import launch

starttime = datetime.utcnow()
log_dir = "/path/log/" + starttime.strftime("launch_%Y-%m-%d_%H-%M-%S/")
launch.logging.launch_config.log_dir = log_dir

def generate_launch_description():
edit flag offensive delete link more



I tried this answer. It only puts the log from the launch file to the specified log folder. the log from the nodes still go to the default log folder. Is that your experience as well?

apoorvcn47 gravatar image apoorvcn47  ( 2021-05-13 11:59:43 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2020-07-21 21:06:55 -0600

Seen: 115 times

Last updated: Aug 01 '20