about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2023-07-22 12:36:03 +0300
committerVika <vika@fireburn.ru>2023-07-22 12:36:03 +0300
commit827aa789dab67eba2d117298cac60f3f1ea2c7e4 (patch)
treef748bc3b38b327d30c7c521fa6e6dd90ceb5df78
parentd1e24e7eec0ecef163ab1c3b99286aafafa0bdc9 (diff)
downloadkittybox-827aa789dab67eba2d117298cac60f3f1ea2c7e4.tar.zst
dev.sh: small modifications
-rwxr-xr-xkittybox-rs/dev.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/kittybox-rs/dev.sh b/kittybox-rs/dev.sh
index 52933ce..979b85a 100755
--- a/kittybox-rs/dev.sh
+++ b/kittybox-rs/dev.sh
@@ -1,5 +1,7 @@
 #!/bin/sh
-export RUST_LOG="kittybox=debug,retainer::cache=warn,h2=info,rustls=info,tokio=info,tower_http::trace=debug,sqlx=trace"
+if [[ -z $KITTYBOX_LOG ]]; then
+    export KITTYBOX_LOG="kittybox=debug,retainer::cache=warn,h2=info,rustls=info,tokio=info,tower_http::trace=debug,sqlx=trace"
+fi
 #export BACKEND_URI=file://./test-dir
 export BACKEND_URI="postgres://localhost?dbname=kittybox&host=/run/postgresql"
 export JOB_QUEUE_URI="postgres://localhost?dbname=kittybox&host=/run/postgresql"
@@ -12,11 +14,18 @@ if [[ "$1" == "watch" ]]; then
 	exec systemfd --no-pid -s http::8080 -- cargo watch \
          --ignore '.direnv' \
          --ignore '*~' \
+         -L "$KITTYBOX_LOG" \
          -x run \
          "$@"
 elif [[ "$1" == "run" ]]; then
 	shift 1
+    export RUST_LOG="$KITTYBOX_LOG"
 	exec cargo run "$@"
+elif [[ "$1" == "_run" ]]; then
+	shift 1
+	release=$1
+	shift 1
+	exec target/${release}/kittybox "$@"
 else
 	echo "Usage: ./dev.sh [watch|run]"
 	exit 1