[logback-dev] svn commit: r777 - in logback/trunk: logback-access/src/main/java/ch/qos/logback/access/html logback-classic/src/main/java/ch/qos/logback/classic/html logback-core/src/main/java/ch/qos/logback/core/html
noreply.seb at qos.ch
noreply.seb at qos.ch
Wed Oct 25 17:12:50 CEST 2006
Author: seb
Date: Wed Oct 25 17:12:50 2006
New Revision: 777
Added:
logback/trunk/logback-access/src/main/java/ch/qos/logback/access/html/DefaultCssBuilder.java
logback/trunk/logback-access/src/main/java/ch/qos/logback/access/html/UrlCssBuilder.java
logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/html/DefaultCssBuilder.java
logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/html/UrlCssBuilder.java
Removed:
logback/trunk/logback-core/src/main/java/ch/qos/logback/core/html/DefaultCssBuilder.java
logback/trunk/logback-core/src/main/java/ch/qos/logback/core/html/UrlCssBuilder.java
Modified:
logback/trunk/logback-access/src/main/java/ch/qos/logback/access/html/HTMLLayout.java
logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/html/HTMLLayout.java
Log:
created module specific implementations of UrlCssBuilder.java and DefaultCssBuilder.java
removed core module classes
Added: logback/trunk/logback-access/src/main/java/ch/qos/logback/access/html/DefaultCssBuilder.java
==============================================================================
--- (empty file)
+++ logback/trunk/logback-access/src/main/java/ch/qos/logback/access/html/DefaultCssBuilder.java Wed Oct 25 17:12:50 2006
@@ -0,0 +1,80 @@
+/**
+ * Logback: the reliable, generic, fast and flexible logging framework.
+ *
+ * Copyright (C) 1999-2006, QOS.ch
+ *
+ * This library is free software, you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation.
+ */
+package ch.qos.logback.access.html;
+
+import static ch.qos.logback.core.Layout.LINE_SEP;
+import ch.qos.logback.core.html.CssBuilder;
+
+/**
+ * This class helps the HTMLLayout build the CSS link. It either provides the
+ * HTMLLayout with a default css file, or builds the link to an external,
+ * user-specified, file.
+ *
+ * @author Sébastien Pennec
+ */
+public class DefaultCssBuilder implements CssBuilder {
+
+ public DefaultCssBuilder() {
+ }
+
+ public void addCss(StringBuffer sbuf) {
+ sbuf.append("<STYLE type=\"text/css\">");
+ sbuf.append(" table { ");
+ sbuf.append(" margin-left: 2em; ");
+ sbuf.append(" margin-right: 2em; ");
+ sbuf.append(" border-left: 2px solid #AAA; ");
+ sbuf.append("}");
+ sbuf.append(LINE_SEP);
+ sbuf.append("TR.even { ");
+ sbuf.append(" background: #FFFFFF; ");
+ sbuf.append("}");
+ sbuf.append(LINE_SEP);
+ sbuf.append("TR.odd { ");
+ sbuf.append(" background: #EAEAEA; ");
+ sbuf.append("}");
+ sbuf.append(LINE_SEP);
+ sbuf.append("TD { ");
+ sbuf.append(" padding-right: 1ex; ");
+ sbuf.append(" padding-left: 1ex; ");
+ sbuf.append(" border-right: 2px solid #AAA;");
+ sbuf.append("}");
+ sbuf.append(LINE_SEP);
+ sbuf.append("TD.Time, TD.Date { ");
+ sbuf.append(" text-align: right; ");
+ sbuf.append(" font-family: courier, monospace; ");
+ sbuf.append(" font-size: smaller; ");
+ sbuf.append("}");
+ sbuf.append(LINE_SEP);
+ sbuf
+ .append("TD.RemoteHost, TD.RequestProtocol, TD.RequestHeader, TD.RequestURL, TD.RemoteUser, TD.RequestURI, TD.ServerName {");
+ sbuf.append(" text-align: left; ");
+ sbuf.append("}");
+ sbuf.append(LINE_SEP);
+ sbuf
+ .append("TD.RequestAttribute, TD.RequestCookie, TD.ResponseHeader, TD.RequestParameter {");
+ sbuf.append(" text-align: left; ");
+ sbuf.append("}");
+ sbuf.append(LINE_SEP);
+ sbuf
+ .append("TD.RemoteIPAddress, TD.LocalIPAddress, TD.ContentLength, TD.StatusCode, TD.LocalPort {");
+ sbuf.append(" text-align: right; ");
+ sbuf.append("}");
+ sbuf.append(LINE_SEP);
+ sbuf.append("TR.header { ");
+ sbuf.append(" background: #596ED5; ");
+ sbuf.append(" color: #FFF; ");
+ sbuf.append(" font-weight: bold; ");
+ sbuf.append(" font-size: larger; ");
+ sbuf.append("}");
+ sbuf.append(LINE_SEP);
+ sbuf.append(" }");
+ sbuf.append("}");
+ }
+}
\ No newline at end of file
Modified: logback/trunk/logback-access/src/main/java/ch/qos/logback/access/html/HTMLLayout.java
==============================================================================
--- logback/trunk/logback-access/src/main/java/ch/qos/logback/access/html/HTMLLayout.java (original)
+++ logback/trunk/logback-access/src/main/java/ch/qos/logback/access/html/HTMLLayout.java Wed Oct 25 17:12:50 2006
@@ -15,7 +15,7 @@
import ch.qos.logback.access.AccessLayout;
import ch.qos.logback.access.PatternLayout;
import ch.qos.logback.access.spi.AccessEvent;
-import ch.qos.logback.core.html.DefaultCssBuilder;
+import ch.qos.logback.access.html.DefaultCssBuilder;
import ch.qos.logback.core.html.HTMLLayoutBase;
import ch.qos.logback.core.html.NOPThrowableRenderer;
import ch.qos.logback.core.pattern.Converter;
Added: logback/trunk/logback-access/src/main/java/ch/qos/logback/access/html/UrlCssBuilder.java
==============================================================================
--- (empty file)
+++ logback/trunk/logback-access/src/main/java/ch/qos/logback/access/html/UrlCssBuilder.java Wed Oct 25 17:12:50 2006
@@ -0,0 +1,42 @@
+/**
+ * Logback: the reliable, generic, fast and flexible logging framework.
+ *
+ * Copyright (C) 1999-2006, QOS.ch
+ *
+ * This library is free software, you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation.
+ */
+package ch.qos.logback.access.html;
+
+import ch.qos.logback.core.html.CssBuilder;
+
+
+/**
+ * This class helps the HTMLLayout build the CSS link.
+ * It either provides the HTMLLayout with a default css file,
+ * or builds the link to an external, user-specified, file.
+ *
+ * @author Sébastien Pennec
+ */
+public class UrlCssBuilder implements CssBuilder {
+
+ String url = "http://logback.qos.ch/css/access.css";
+
+ public UrlCssBuilder() {
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public void addCss(StringBuffer sbuf) {
+ sbuf.append("<LINK REL=StyleSheet HREF=\"");
+ sbuf.append(url);
+ sbuf.append("\" TITLE=\"Basic\" />");
+ }
+}
Added: logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/html/DefaultCssBuilder.java
==============================================================================
--- (empty file)
+++ logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/html/DefaultCssBuilder.java Wed Oct 25 17:12:50 2006
@@ -0,0 +1,72 @@
+/**
+ * Logback: the reliable, generic, fast and flexible logging framework.
+ *
+ * Copyright (C) 1999-2006, QOS.ch
+ *
+ * This library is free software, you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation.
+ */
+package ch.qos.logback.classic.html;
+
+import static ch.qos.logback.core.Layout.LINE_SEP;
+import ch.qos.logback.core.html.CssBuilder;
+
+/**
+ * This class helps the HTMLLayout build the CSS link. It either provides the
+ * HTMLLayout with a default css file, or builds the link to an external,
+ * user-specified, file.
+ *
+ * @author Sébastien Pennec
+ */
+public class DefaultCssBuilder implements CssBuilder {
+
+ public DefaultCssBuilder() {
+ }
+
+ public void addCss(StringBuffer sbuf) {
+ sbuf.append("<STYLE type=\"text/css\">");
+ sbuf.append(LINE_SEP);
+ sbuf
+ .append("table { margin-left: 2em; margin-right: 2em; border-left: 2px solid #AAA; }");
+ sbuf.append(LINE_SEP);
+
+ sbuf.append("TR.even { background: #FFFFFF; }");
+ sbuf.append(LINE_SEP);
+
+ sbuf.append("TR.odd { background: #EAEAEA; }");
+ sbuf.append(LINE_SEP);
+
+ sbuf
+ .append("TR.warn TD.Level, TR.error TD.Level, TR.fatal TD.Level {font-weight: bold; color: #FF4040 }");
+ sbuf.append(LINE_SEP);
+
+ sbuf
+ .append("TD { padding-right: 1ex; padding-left: 1ex; border-right: 2px solid #AAA; }");
+ sbuf.append(LINE_SEP);
+
+ sbuf
+ .append("TD.Time, TD.Date { text-align: right; font-family: courier, monospace; font-size: smaller; }");
+ sbuf.append(LINE_SEP);
+
+ sbuf.append("TD.Thread { text-align: left; }");
+ sbuf.append(LINE_SEP);
+
+ sbuf.append("TD.Level { text-align: right; }");
+ sbuf.append(LINE_SEP);
+
+ sbuf.append("TD.Logger { text-align: left; }");
+ sbuf.append(LINE_SEP);
+
+ sbuf
+ .append("TR.header { background: #596ED5; color: #FFF; font-weight: bold; font-size: larger; }");
+ sbuf.append(LINE_SEP);
+
+ sbuf
+ .append("TD.Exception { background: #A2AEE8; font-family: courier, monospace;}");
+ sbuf.append(LINE_SEP);
+
+ sbuf.append("</STYLE>");
+ sbuf.append(LINE_SEP);
+ }
+}
Modified: logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/html/HTMLLayout.java
==============================================================================
--- logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/html/HTMLLayout.java (original)
+++ logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/html/HTMLLayout.java Wed Oct 25 17:12:50 2006
@@ -15,7 +15,7 @@
import ch.qos.logback.classic.ClassicLayout;
import ch.qos.logback.classic.PatternLayout;
import ch.qos.logback.classic.spi.LoggingEvent;
-import ch.qos.logback.core.html.DefaultCssBuilder;
+import ch.qos.logback.classic.html.DefaultCssBuilder;
import ch.qos.logback.core.html.HTMLLayoutBase;
import ch.qos.logback.core.pattern.Converter;
Added: logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/html/UrlCssBuilder.java
==============================================================================
--- (empty file)
+++ logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/html/UrlCssBuilder.java Wed Oct 25 17:12:50 2006
@@ -0,0 +1,42 @@
+/**
+ * Logback: the reliable, generic, fast and flexible logging framework.
+ *
+ * Copyright (C) 1999-2006, QOS.ch
+ *
+ * This library is free software, you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation.
+ */
+package ch.qos.logback.classic.html;
+
+import ch.qos.logback.core.html.CssBuilder;
+
+
+/**
+ * This class helps the HTMLLayout build the CSS link.
+ * It either provides the HTMLLayout with a default css file,
+ * or builds the link to an external, user-specified, file.
+ *
+ * @author Sébastien Pennec
+ */
+public class UrlCssBuilder implements CssBuilder {
+
+ String url = "http://logback.qos.ch/css/classic.css";
+
+ public UrlCssBuilder() {
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public void addCss(StringBuffer sbuf) {
+ sbuf.append("<LINK REL=StyleSheet HREF=\"");
+ sbuf.append(url);
+ sbuf.append("\" TITLE=\"Basic\" />");
+ }
+}
More information about the logback-dev
mailing list