diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-10-13 08:37:14 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-10-13 08:37:14 +0900 |
| commit | 8063ca459b8bcd1524951a54d056cf3bd50358e0 (patch) | |
| tree | 071d617fd5f352114560391420c891c995e62bcc | |
| parent | b91827e2a8f1b502a823893b8cd01c51600fcd40 (diff) | |
modified shell/aliasrc, modified bin/ylog
| -rw-r--r-- | mac/.config/shell/aliasrc | 4 | ||||
| -rwxr-xr-x | mac/.local/bin/ylog | 14 |
2 files changed, 12 insertions, 6 deletions
diff --git a/mac/.config/shell/aliasrc b/mac/.config/shell/aliasrc index 6f06710..359e951 100644 --- a/mac/.config/shell/aliasrc +++ b/mac/.config/shell/aliasrc @@ -497,3 +497,7 @@ alias za='zathura' # zsh alias sps="source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/profile" alias szs="source ${XDG_CONFIG_HOME:-${HOME}/.config}/zsh/.zshrc" + + +alias ylogt='ylog -s recordings -c us | grep $(LC_TIME=C date +%d/%b)' +alias ylogy='ylog -s recordings -c us | grep $(LC_TIME=C date -v-1d +%d/%b)' diff --git a/mac/.local/bin/ylog b/mac/.local/bin/ylog index 1cfc52f..f15fb3b 100755 --- a/mac/.local/bin/ylog +++ b/mac/.local/bin/ylog @@ -9,7 +9,7 @@ SCOPE="all" # all|access|recordings EXCL_FIREFOX=1 # 1 = exclude Firefox lines by default EXCLUDES="59.19.56.8" # default exclude pattern ADD_EXCLUDES="" -LINE_LIMIT=10 # default number of lines when TARGET=all +LINE_LIMIT=30 # default number of lines when TARGET=all usage() { cat <<'EOF' @@ -81,11 +81,13 @@ LINE_LIMIT='"$LINE_LIMIT"' # collect files pick_files() { - # recordings: always include recordings.access.log (old merged logs) + # recordings: include recordings.access.log only if COUNTRY=all if [ "$SCOPE" = "recordings" ] || [ "$SCOPE" = "all" ]; then - for q in "$LOG_DIR/recordings.access.log" "$LOG_DIR/recordings.access.log".*; do - [ -e "$q" ] && printf "%s\n" "$q" - done + if [ "$COUNTRY" = "all" ]; then + for q in "$LOG_DIR/recordings.access.log" "$LOG_DIR/recordings.access.log".*; do + [ -e "$q" ] && printf "%s\n" "$q" + done + fi case "$COUNTRY" in kr) for q in "$LOG_DIR/recordings.kr.log" "$LOG_DIR/recordings.kr.log".*; do [ -e "$q" ] && printf "%s\n" "$q"; done ;; us) for q in "$LOG_DIR/recordings.us.log" "$LOG_DIR/recordings.us.log".*; do [ -e "$q" ] && printf "%s\n" "$q"; done ;; @@ -149,7 +151,7 @@ for f in $(cat "$FILES_TMP"); do if [ "$TARGET" = "all" ]; then cmd="$reader" else - cmd="$reader | grep -E -- \"${ESC_TARGET}[[:space:]]\"" + cmd="$reader | grep -E -- \"${ESC_TARGET}\"" fi if [ -n "${EXRE:-}" ]; then |
