[logback-dev] [GIT] Logback: the generic, reliable, fast and flexible logging framework. branch, master, updated. v_0.9.28-18-g6cacf87

added by portage for gitosis-gentoo git-noreply at pixie.qos.ch
Mon Mar 7 19:58:24 CET 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Logback: the generic, reliable, fast and flexible logging framework.".

The branch, master has been updated
       via  6cacf873a1691b3ce233e5eebaf846f652cdb12b (commit)
      from  ad8b72b119ed9beff2ef4f11b814586e8de5479e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=6cacf873a1691b3ce233e5eebaf846f652cdb12b
http://github.com/ceki/logback/commit/6cacf873a1691b3ce233e5eebaf846f652cdb12b

commit 6cacf873a1691b3ce233e5eebaf846f652cdb12b
Author: Ceki Gulcu <ceki at qos.ch>
Date:   Mon Mar 7 19:54:16 2011 +0100

    added doc improvements suggested by David Beamer

diff --git a/logback-examples/src/main/java/chapters/architecture/SelectionRule.java b/logback-examples/src/main/java/chapters/architecture/SelectionRule.java
new file mode 100644
index 0000000..d4debd4
--- /dev/null
+++ b/logback-examples/src/main/java/chapters/architecture/SelectionRule.java
@@ -0,0 +1,38 @@
+package chapters.architecture;
+
+import ch.qos.logback.classic.Level;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author Ceki G&uuml;c&uuml;
+ */
+public class SelectionRule {
+
+  public static void main(String[] args) {
+    // get a logger instance named "com.foo". Let us further assume that the
+    // logger is of type  ch.qos.logback.classic.Logger so that we can
+    // set its level
+    ch.qos.logback.classic.Logger logger = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger("com.foo");
+    //set its Level to INFO. The setLevel() method requires a logback logger
+    logger.setLevel(Level.INFO);
+
+    Logger barlogger = LoggerFactory.getLogger("com.foo.Bar");
+
+    // This request is enabled, because WARN >= INFO
+    logger.warn("Low fuel level.");
+
+    // This request is disabled, because DEBUG < INFO.
+    logger.debug("Starting search for nearest gas station.");
+
+    // The logger instance barlogger, named "com.foo.Bar",
+    // will inherit its level from the logger named
+    // "com.foo" Thus, the following request is enabled
+    // because INFO >= INFO.
+    barlogger.info("Located nearest gas station.");
+
+    // This request is disabled, because DEBUG < INFO.
+    barlogger.debug("Exiting gas station search");
+
+  }
+}
diff --git a/logback-site/src/site/pages/manual/architecture.html b/logback-site/src/site/pages/manual/architecture.html
index 939636b..9a3f956 100644
--- a/logback-site/src/site/pages/manual/architecture.html
+++ b/logback-site/src/site/pages/manual/architecture.html
@@ -436,10 +436,19 @@ public interface Logger {
 		
 		<p>Here is an example of the basic selection rule.</p>
 
-		<pre class="prettyprint source">// get a logger instance named "com.foo"
-Logger logger = LoggerFactory.getLogger("com.foo");
-//set its Level to <span class="blue">INFO</span>
+		<pre class="prettyprint source">import ch.qos.logback.classic.Level;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+....
+
+// get a logger instance named "com.foo". Let us further assume that the
+// logger is of type  ch.qos.logback.classic.Logger so that we can
+// set its level
+ch.qos.logback.classic.Logger logger = 
+        (ch.qos.logback.classic.Logger) LoggerFactory.getLogger("com.foo");
+//set its Level to <span class="blue">INFO</span>. The setLevel() method requires a logback logger
 logger.setLevel(Level. <span class="blue">INFO</span>);
+
 Logger barlogger = LoggerFactory.getLogger("com.foo.Bar");
 
 // This request is enabled, because <span class="green bold">WARN</span> &gt;= <span class="blue">INFO</span>
diff --git a/logback-site/src/site/pages/manual/configuration.html b/logback-site/src/site/pages/manual/configuration.html
index 17fc59e..38a8de0 100644
--- a/logback-site/src/site/pages/manual/configuration.html
+++ b/logback-site/src/site/pages/manual/configuration.html
@@ -159,8 +159,9 @@ public class MyApp1 {
   }
 }</pre>
 
-  <p>This class defines a static logger variable. It then
-  instantiates a Foo object. The Foo class is listed below:
+  <p>This class defines a static logger variable. It then instantiates
+  a <code>Foo</code> object. The <code>Foo</code> class is listed
+  below:
   </p>
 
   <p class="example">Example: Small class doing logging 
@@ -195,8 +196,9 @@ public class Foo {
     configuration consists of a <code>ConsoleAppender</code> attached
     to the root logger.  The output is formatted using a
     <code>PatternLayoutEncoder</code> set to the pattern
-    <em>%d{HH:mm:ss.SSS}&nbsp;[%thread]&nbsp;%-5level&nbsp;%logger{36}&nbsp;-&nbsp;%msg%n</em>. Moreover, by default the root logger is assigned the
-    <code>DEBUG</code> level.
+    <em>%d{HH:mm:ss.SSS}&nbsp;[%thread]&nbsp;%-5level&nbsp;%logger{36}&nbsp;-&nbsp;%msg%n</em>. Moreover,
+    by default the root logger is assigned the <code>DEBUG</code>
+    level.
     </p>
 
     <p>Thus, the output of the command <em>java chapters.configuration.MyApp1</em>
@@ -684,7 +686,7 @@ public class MyApp3 {
     <p>If you are unsure which case to use for a given tag name, just
     follow the <a
     href="http://en.wikipedia.org/wiki/CamelCase">camelCase
-    convention</a> which is almost always the corrrect convention.</p>
+    convention</a> which is almost always the correct convention.</p>
     </div>
 
     <h4><a name="caseSensitivity" href="#caseSensitivity">Case

-----------------------------------------------------------------------

Summary of changes:
 .../java/chapters/architecture/SelectionRule.java  |   38 ++++++++++++++++++++
 .../src/site/pages/manual/architecture.html        |   15 ++++++--
 .../src/site/pages/manual/configuration.html       |   12 ++++---
 3 files changed, 57 insertions(+), 8 deletions(-)
 create mode 100644 logback-examples/src/main/java/chapters/architecture/SelectionRule.java


hooks/post-receive
-- 
Logback: the generic, reliable, fast and flexible logging framework.


More information about the logback-dev mailing list