Skip to content

Instantly share code, notes, and snippets.

@whamtet
Created July 25, 2023 00:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whamtet/c578c6a84b30f1ece8bc7486363d71dc to your computer and use it in GitHub Desktop.
Save whamtet/c578c6a84b30f1ece8bc7486363d71dc to your computer and use it in GitHub Desktop.
#!/usr/bin/env bb -i
;; Usage:
;; Install babashka at https://github.com/babashka/babashka
;; put this script on PATH and make it executable
;; copy logs to the clipboard
;; to filter SimpleAsyncTaskExecutor-3 run
;; pbpaste | slct.clj 3
(require '[clojure.string :as string])
(def log-strs
(string/join "\n" *input*))
(def string-match
(str "SimpleAsyncTaskExecutor-" (first *command-line-args*)))
(-> log-strs
(.split "\\[INFO\\]")
(->>
(filter #(.contains % string-match))
(string/join "\n")
println))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment