Handle localadmin and log-prefix.

This commit is contained in:
John Wiseman 2020-05-05 17:52:11 -07:00
parent b9c2e02ecb
commit 9ab7b0616f

View File

@ -176,7 +176,8 @@
(defn screenshot [icao lat lon now]
(p/let [image-path (str icao "-" (util/format-utc-ts now) ".png")
(p/let [image-path (str (string/join "-" [@log-prefix icao (util/format-utc-ts now)])
".png")
_ (adsbx/screenshot-aircraft icao lat lon
{:timeout 30000
:output-path image-path
@ -300,7 +301,7 @@
"?:[(callsign {callsign}) ]"
;; Ideally neighbourhood as well as city or county, but
;; maybe just city.
"is circling over [{neighbourhood}, {locality}|{neighbourhood}, {county}|{locality}] "
"is circling over [{neighbourhood}, {locality}|{neighbourhood}, {county}|{locality}|{localadmin}] "
;; Altitude.
"?:[at {alt} feet, ]"
;; Speed;
@ -515,7 +516,8 @@
lat
lon)
(log-warn "Skipping tweeting"))
(let [path (str icao "-" (util/format-utc-ts now) ".geojson")]
(let [path (str (string/join "-" [@log-prefix icao (util/format-utc-ts now)])
".geojson")]
(util/write-file
path
(.stringify
@ -617,9 +619,7 @@
(.option "--log-prefix <prefix>" "Log prefix to use")
(.parse (.-argv js/process)))
(logging/set-log-prefix! (or (.-logPrefix commander) ""))
(reset! log-prefix (if (.-logPrefix commander)
(str (.-logPrefix commander) "-")
""))
(reset! log-prefix (or (.-logPrefix commander) ""))
(let [start-time (current-time)]
;; If --config-path is specified, definitely try to read that
;; file. Otherwise, only read config.yaml if it exists.