apollo icon indicating copy to clipboard operation
apollo copied to clipboard

LOG: How to check all logs, info, debug, error logs of any module ?

Open srikara123 opened this issue 8 years ago • 5 comments

Hi

once can module is up, the logs can be seen in /apollo/data/log/canbus.out but only error logs are being shown, how to check all logs ? Thanks, Srikar

srikara123 avatar Mar 27 '18 06:03 srikara123

It follows glog. You can set --v=4 to output debug information.

lianglia-apollo avatar Mar 27 '18 16:03 lianglia-apollo

set at run time / Compile time ?

srikara123 avatar Mar 28 '18 10:03 srikara123

Please set at run time. For example:

/apollo/bazel-bin/modules/planning/planning --flagfile=modules/planning/conf/planning.conf --log_dir=/apollo/data/log --use_navigation_mode --v=4

The log of apollo is defined in /apollo/modules/common/log.h:

#define ADEBUG VLOG(4) << "[DEBUG] "
#define AINFO LOG(INFO)
#define AWARN LOG(WARNING)
#define AERROR LOG(ERROR)
#define AFATAL LOG(FATAL)
... ...
... ...

More information on glog can be found at http://rpg.ifi.uzh.ch/docs/glog.html

lianglia-apollo avatar Mar 28 '18 18:03 lianglia-apollo

Why is apollo not using ROS logging mechanism: http://wiki.ros.org/roscpp/Overview/Logging?

Also are you logging to files during runtime? If yes this then means that you are using system calls such as fopen, fwrite, etc which use blocking threads and which is not safe to use because they make your application hang (and possibly crash).

ubercool2 avatar Mar 31 '18 01:03 ubercool2

Normally,if you launch planning module,you could find log in the directory apollo/data/log. It would have planning.INFO,planning.ERROR,etc.if you want to see the DEBUG,you add one line --v=4 into file planning.conf.You canfind DEBUG in the planning.INFO.

gengqx avatar Mar 31 '18 16:03 gengqx