From e15462e0d75ea76303dd4310200204578279b208 Mon Sep 17 00:00:00 2001 From: Stephan Wendel Date: Sun, 5 Feb 2023 13:13:31 +0100 Subject: [PATCH] chore: change prefix of log messages According to discuss, in PR #78, adding a Prefix for better readability Signed-off-by: Stephan Wendel --- libs/v4l2_control.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/libs/v4l2_control.sh b/libs/v4l2_control.sh index 9bcec71c..95409d2f 100755 --- a/libs/v4l2_control.sh +++ b/libs/v4l2_control.sh @@ -19,7 +19,9 @@ set -eE function v4l2_control { - log_msg "V4L2 Control:" + v4c_log_msg() { + log_msg "V4L2 Control: ${1}" + } function main { local device v4l2ctl valueless opt_avail @@ -31,8 +33,8 @@ function v4l2_control { # if not empty do if [ -n "${v4l2ctl}" ]; then # Write configured options to Log - log_msg "Device: [cam ${cam}]" - log_msg "Options: ${v4l2ctl}" + v4c_log_msg "Device: [cam ${cam}]" + v4c_log_msg "Options: ${v4l2ctl}" # Split options to array IFS=',' read -ra opt < <(echo "${v4l2ctl}"); unset IFS # loop through options @@ -43,7 +45,7 @@ function v4l2_control { opt_avail="$(v4l2-ctl -d "${device}" -L | \ grep -c "${valueless}" || true)" if [ "${opt_avail}" -eq "0" ]; then - log_msg "Parameter '${param}' not available for '${device}'. Skipped." + v4c_log_msg "Parameter '${param}' not available for '${device}'. Skipped." else v4l2-ctl -d "${device}" -c "${param}" 2> /dev/null fi @@ -52,7 +54,7 @@ function v4l2_control { v4l2-ctl -d "${device}" -L | log_output "v4l2ctl" fi else - log_msg "No parameters set for [cam ${cam}]. Skipped." + v4c_log_msg "No parameters set for [cam ${cam}]. Skipped." fi done }