1
0
mirror of https://github.com/Zygo/bees.git synced 2025-06-15 09:16:34 +02:00

Add option for prefixing timestamps

To make bees more friendly to use with syslog/systemd, we add an option
to omit timestamps from the log output.

Signed-off-by: Kai Krakow <kai@kaishome.de>
This commit is contained in:
Kai Krakow
2017-10-27 23:02:47 +02:00
parent c6bf6bfe1d
commit c6be07e158
4 changed files with 41 additions and 25 deletions

View File

@ -49,7 +49,6 @@ BEESHOME="${BEESHOME:-$MNT_DIR/.beeshome}"
BEESSTATUS="${BEESSTATUS:-$WORK_DIR/$UUID.status}"
DB_SIZE="${DB_SIZE:-$((64*AL16M))}"
LOG_SHORT_PATH="${LOG_SHORT_PATH:-N}"
LOG_FILTER_TIME="${LOG_FILTER_TIME:-N}"
INFO "Check: Disk exists"
if [ ! -b "/dev/disk/by-uuid/$UUID" ]; then
@ -101,19 +100,6 @@ fi
MNT_DIR="${MNT_DIR//\/\//\/}"
filter_time(){
if YN $LOG_FILTER_TIME; then
sed -e 's/^.*crawl:/crawl:/g' \
-e 's/^.*status:/status:/g' \
-e 's/^.*bees:/bees:/g' \
-e 's/^.*crawl_writeback:/crawl_writeback:/g' \
-e 's/^.*main:/main:/g' \
-e 's/^.*hash_prefetch:/hash_prefetch:/g'
else
cat
fi
}
filter_path(){
if YN $LOG_SHORT_PATH; then
sed -e "s#$MNT_DIR##g"
@ -122,6 +108,6 @@ filter_path(){
fi
}
@LIBEXEC_PREFIX@/bees "$MNT_DIR" 3>&1 2>&1 | filter_time | filter_path
@LIBEXEC_PREFIX@/bees $OPTIONS "$MNT_DIR" 3>&1 2>&1 | filter_path
exit 0