Skip to content

Commit

Permalink
chore: change prefix of log messages
Browse files Browse the repository at this point in the history
According to discuss, in PR #78, adding a Prefix for better readability

Signed-off-by: Stephan Wendel <[email protected]>
  • Loading branch information
KwadFan committed Feb 5, 2023
1 parent 6152fb2 commit e15462e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions libs/v4l2_control.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
}
Expand Down

0 comments on commit e15462e

Please sign in to comment.