Skip to content

Commit 2f0813b

Browse files
committed
add "--debug" flag to enable log level debug
1 parent cb0f82b commit 2f0813b

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/mobdap/main.clj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414

1515
(def cli-options
1616
[["-v" "--version" "Show the installed version of mobdap"]
17-
["-h" "--help" "Show the help text"]])
17+
["-h" "--help" "Show the help text"]
18+
[nil "--debug" "Show debug logs"]])
1819

1920
(defn- print-usage [result]
2021
(println "Usage:")
@@ -43,8 +44,11 @@
4344
:else
4445
(do
4546
(log/set-config!
46-
{:level :info
47+
{:level (if (get-in res [:options :debug])
48+
:debug
49+
:info)
4750
:appenders {:spit (appenders/spit-appender {:fname (str (io/file (cache-dir) "mobdap.log"))})}})
4851
(log/info "Started mobdap with arguments:" args)
52+
(log/debug "CLI Options" (dissoc res :summary))
4953
(handler/run)))))
5054

0 commit comments

Comments
 (0)