Skip to content

Commit e15462e

Browse files
committed
chore: change prefix of log messages
According to discuss, in PR #78, adding a Prefix for better readability Signed-off-by: Stephan Wendel <[email protected]>
1 parent 6152fb2 commit e15462e

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

libs/v4l2_control.sh

+7-5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
set -eE
2020

2121
function v4l2_control {
22-
log_msg "V4L2 Control:"
22+
v4c_log_msg() {
23+
log_msg "V4L2 Control: ${1}"
24+
}
2325

2426
function main {
2527
local device v4l2ctl valueless opt_avail
@@ -31,8 +33,8 @@ function v4l2_control {
3133
# if not empty do
3234
if [ -n "${v4l2ctl}" ]; then
3335
# Write configured options to Log
34-
log_msg "Device: [cam ${cam}]"
35-
log_msg "Options: ${v4l2ctl}"
36+
v4c_log_msg "Device: [cam ${cam}]"
37+
v4c_log_msg "Options: ${v4l2ctl}"
3638
# Split options to array
3739
IFS=',' read -ra opt < <(echo "${v4l2ctl}"); unset IFS
3840
# loop through options
@@ -43,7 +45,7 @@ function v4l2_control {
4345
opt_avail="$(v4l2-ctl -d "${device}" -L | \
4446
grep -c "${valueless}" || true)"
4547
if [ "${opt_avail}" -eq "0" ]; then
46-
log_msg "Parameter '${param}' not available for '${device}'. Skipped."
48+
v4c_log_msg "Parameter '${param}' not available for '${device}'. Skipped."
4749
else
4850
v4l2-ctl -d "${device}" -c "${param}" 2> /dev/null
4951
fi
@@ -52,7 +54,7 @@ function v4l2_control {
5254
v4l2-ctl -d "${device}" -L | log_output "v4l2ctl"
5355
fi
5456
else
55-
log_msg "No parameters set for [cam ${cam}]. Skipped."
57+
v4c_log_msg "No parameters set for [cam ${cam}]. Skipped."
5658
fi
5759
done
5860
}

0 commit comments

Comments
 (0)