with-logger macro #6

Closed
wants to merge 5 commits into
from

Conversation

Projects
None yet
3 participants
@ikitommi

One can override the default namespace used in logging with a with-logger macro (or binding *logger-ns*).

(deftest logp-macro-with-logger
  (with-logger "kikka"
    (info "kukka"))
  (is (= ["kikka"
          :info
          nil
          "kukka"]
        (peek @*entries*))))

I have a case where I need to log explicitly to different logs, this seems to be nice way to do it.

Added also few tests for the logp and logf -based macro loggings.

regards,

Tommi

@seancorfield

This comment has been minimized.

Show comment Hide comment
@seancorfield

seancorfield Feb 14, 2013

Member

Hi Tommi, thanks for the suggestions but Clojure Contrib projects cannot accept pull requests per http://clojure.org/contributing

Pull requests are often a good way to provide a basis for discussion around possible new features that leads to tickets in JIRA and patches from folks with a signed Contributor's Agreement on file. You can find links to JIRA on this page for each Contrib project: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go

I'll leave this open for the project lead to review and discuss with you.

Member

seancorfield commented Feb 14, 2013

Hi Tommi, thanks for the suggestions but Clojure Contrib projects cannot accept pull requests per http://clojure.org/contributing

Pull requests are often a good way to provide a basis for discussion around possible new features that leads to tickets in JIRA and patches from folks with a signed Contributor's Agreement on file. You can find links to JIRA on this page for each Contrib project: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go

I'll leave this open for the project lead to review and discuss with you.

@ikitommi

This comment has been minimized.

Show comment Hide comment
@ikitommi

ikitommi Feb 15, 2013

hi,

and thanks for explaining the process, didn't know that. I'll wait for the review and if the changes are good and interesting enough, I'll use the normal process to get them in.

Added also test coverage.

br,

Tommi

hi,

and thanks for explaining the process, didn't know that. I'll wait for the review and if the changes are good and interesting enough, I'll use the normal process to get them in.

Added also test coverage.

br,

Tommi

@ataggart

This comment has been minimized.

Show comment Hide comment
@ataggart

ataggart Jun 8, 2014

Member

The proposed solution changes the log-ns for every log invocation in the call tree, not just for the invocations within the lexical scope of with-logger. The log macro already allows for specifying the log-ns.

Member

ataggart commented Jun 8, 2014

The proposed solution changes the log-ns for every log invocation in the call tree, not just for the invocations within the lexical scope of with-logger. The log macro already allows for specifying the log-ns.

@ataggart ataggart closed this Jun 8, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment