Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wip level and stacktrace output #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/clj_journal/timbre.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(ns clj-journal.timbre
(:require [clj-journal.log :refer [jsend]]))
(:require [clojure.string :as str]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whops, I think the :as str part could be removed.

[clj-journal.log :refer [jsend]]))

(def timbre->syslog-map
"Map timbre log levels to syslog levels"
Expand Down Expand Up @@ -38,8 +39,9 @@
([data] (journal-output-fn nil data))
([opts data] ; For partials
(let [{:keys [show-fields? no-stacktrace? stacktrace-fonts]} opts
{:keys [?err vargs msg_ ?ns-str ?file ?line]} data]
(str "[" (or ?ns-str ?file "?") ":" (or ?line "?") "] - "
{:keys [level ?err vargs msg_ ?ns-str ?file ?line]} data]
(str (str/upper-case (name level)) " "
"[" (or ?ns-str ?file "?") ":" (or ?line "?") "] - "
(if show-fields?
(force msg_)
(clojure.string/join " " (filter (comp not map?) vargs)))
Expand Down