Skip to content

Commit

Permalink
Adding a small code example to demonstrate usage
Browse files Browse the repository at this point in the history
  • Loading branch information
abedra committed Mar 13, 2011
1 parent 672d927 commit f5b9255
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Expand Up @@ -8,6 +8,17 @@ Logging occurs with the log macro, or the level-specific convenience macros, whi

## Usage

The following short example should give you what you need to get started:

(ns example.core
(:use [clojure.tools.logging :only (info error)]))

(defn divide [one two]
(try
(info "Calculated" (/ one two))
(catch Exception ex
(error "There was an error in caculation" ex))))

For those new to using a java logging library, the following is a very basic configuration for log4j. Place it in a file called \"log4j.properties\" and place that file (and the log4j JAR) on the classpath.

log4j.rootLogger=WARN, A1
Expand Down

0 comments on commit f5b9255

Please sign in to comment.