Skip to content

Commit

Permalink
Rename function to run_and_print_lc
Browse files Browse the repository at this point in the history
  • Loading branch information
pabera committed Dec 11, 2023
1 parent e84d8d5 commit 3c62e60
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions installation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
## Logging - Bash Script output rules

```bash
print_lc "This message will be logged to both console and logfile"
print_c "This message will only be logged to the console"
log "This message will only be logged to the logfile"
run_and_log "Run a command and log its output to logfile"
clear_c "Clears the console screen"
run_and_print_lc "Run a command and log its output to logfile"
print_lc "This message will be logged to both console and logfile"
print_c "This message will only be logged to the console"
log "This message will only be logged to the logfile"
clear_c "Clears the console screen"
```

[Learn more about bash script outputs](https://stackoverflow.com/questions/18460186/writing-outputs-to-log-file-and-console)
Expand Down
2 changes: 1 addition & 1 deletion installation/includes/02_helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ run_with_timer() {

$1; # Executes the function passed as an argument

run_and_log calc_runtime_and_print time_start $(date +%s)
run_and_print_lc calc_runtime_and_print time_start $(date +%s)
}

run_with_log_frame() {
Expand Down
2 changes: 1 addition & 1 deletion installation/install-jukebox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ log() {
}

# Function to run a command where the output will be logged to both console and logfile
run_and_log() {
run_and_print_lc() {
"$@" | tee /dev/fd/3
}

Expand Down
2 changes: 1 addition & 1 deletion installation/routines/setup_rfid_reader.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

_run_setup_rfid_reader() {
run_and_log python "${INSTALLATION_PATH}/src/jukebox/run_register_rfid_reader.py"
run_and_print_lc python "${INSTALLATION_PATH}/src/jukebox/run_register_rfid_reader.py"
}

setup_rfid_reader() {
Expand Down

0 comments on commit 3c62e60

Please sign in to comment.