Skip to content

Instantly share code, notes, and snippets.

@KaairaGupta
Forked from kbingham/lcdebug
Created April 22, 2020 16:34
Show Gist options
  • Save KaairaGupta/35879532937660a6a0e786069b731dd7 to your computer and use it in GitHub Desktop.
Save KaairaGupta/35879532937660a6a0e786069b731dd7 to your computer and use it in GitHub Desktop.
lcdebug wrapper helper
#!/bin/bash
# We default to enabling the most debug
# (that's why we're being used right)
FILTER="*"
LEVEL="0"
while [[ $# -gt 0 ]]
do
case $1 in
-x)
set -x;
shift;
;;
-f|--filter)
FILTER="$2";
shift; shift;
;;
-l|--level)
LEVEL="$2";
shift; shift;
;;
-h|--help)
echo "The following filters are available:"
git grep "^LOG_DEFINE_CATEGORY" | \
awk -F '[()]' '{print $2}' | \
sort
exit
;;
*) # unknown option, The rest belongs to the command
break;
;;
esac
done
LIBCAMERA_LOG_LEVELS=$FILTER:$LEVEL "${@}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment