mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
* logging: allow logging backend config * correct board comments * documentation: updated logging section
59 lines
1.1 KiB
Bash
59 lines
1.1 KiB
Bash
#!/bin/sh
|
|
# Standard startup script for logging.
|
|
#
|
|
# NOTE: Script variables are declared/initialized/unset in the rcS script.
|
|
#
|
|
|
|
###############################################################################
|
|
# End Setup for board specific configurations. #
|
|
###############################################################################
|
|
|
|
#
|
|
# Set SD logging mode
|
|
#
|
|
if param compare SDLOG_MODE 1
|
|
then
|
|
set LOGGER_ARGS "${LOGGER_ARGS} -e"
|
|
fi
|
|
|
|
if param compare SDLOG_MODE 2
|
|
then
|
|
set LOGGER_ARGS "${LOGGER_ARGS} -f"
|
|
fi
|
|
|
|
if param compare SDLOG_MODE 3
|
|
then
|
|
set LOGGER_ARGS "${LOGGER_ARGS} -x"
|
|
fi
|
|
|
|
if param compare SDLOG_MODE 4
|
|
then
|
|
set LOGGER_ARGS "${LOGGER_ARGS} -a"
|
|
fi
|
|
|
|
#
|
|
# Set logging backend
|
|
#
|
|
if param compare SDLOG_BACKEND 1
|
|
then
|
|
set LOGGER_ARGS "${LOGGER_ARGS} -m file"
|
|
fi
|
|
|
|
if param compare SDLOG_BACKEND 2
|
|
then
|
|
set LOGGER_ARGS "${LOGGER_ARGS} -m mavlink"
|
|
fi
|
|
|
|
if param compare SDLOG_BACKEND 3
|
|
then
|
|
set LOGGER_ARGS "${LOGGER_ARGS} -m all"
|
|
fi
|
|
|
|
#
|
|
# Start logger if any logging backend is enabled
|
|
#
|
|
if ! param compare SDLOG_BACKEND 0
|
|
then
|
|
logger start -b ${LOGGER_BUF} -t ${LOGGER_ARGS}
|
|
fi
|