ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How do I set the logging directory in Foxy?

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

dawonn_haval gravatar image

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

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

edit retag flag offensive close merge delete

Comments

1

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 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

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

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/")
os.mkdir(log_dir)
launch.logging.reset()
launch.logging.launch_config.log_dir = log_dir

def generate_launch_description():
<SNIP>
edit flag offensive delete link more

Comments

Hi,

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 -0500 )edit

Question Tools

Stats

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

Seen: 257 times

Last updated: Aug 01 '20