diff options
author | James Moger <james.moger@gitblit.com> | 2014-06-27 14:25:42 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-06-27 14:25:42 -0400 |
commit | 20fd881e37c3bf980b25021aff6c0be24082b87c (patch) | |
tree | c67a934383cb4117fac3d0f385f3ed38ee6194a4 | |
parent | ede713df83d03be3ecf7b9c363cead25b52d27f9 (diff) | |
download | gitblit-ticket/114.tar.gz gitblit-ticket/114.zip |
Do not serialize Loggerticket/114
-rw-r--r-- | src/main/java/com/gitblit/wicket/panels/BasePanel.java | 11 | ||||
-rw-r--r-- | src/main/java/com/gitblit/wicket/panels/HistoryPanel.java | 6 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/main/java/com/gitblit/wicket/panels/BasePanel.java b/src/main/java/com/gitblit/wicket/panels/BasePanel.java index e8f8f6f2..73f8e471 100644 --- a/src/main/java/com/gitblit/wicket/panels/BasePanel.java +++ b/src/main/java/com/gitblit/wicket/panels/BasePanel.java @@ -22,6 +22,8 @@ import org.apache.wicket.AttributeModifier; import org.apache.wicket.Component;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.Model;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import com.gitblit.Constants;
import com.gitblit.Keys;
@@ -36,6 +38,8 @@ public abstract class BasePanel extends Panel { private transient TimeUtils timeUtils;
+ private transient Logger logger;
+
public BasePanel(String wicketId) {
super(wicketId);
}
@@ -44,6 +48,13 @@ public abstract class BasePanel extends Panel { return GitBlitWebApp.get();
}
+ protected Logger logger() {
+ if (logger == null) {
+ logger = LoggerFactory.getLogger(getClass());
+ }
+ return logger;
+ }
+
protected String getContextUrl() {
return getRequest().getRelativePathPrefixToContextRoot();
}
diff --git a/src/main/java/com/gitblit/wicket/panels/HistoryPanel.java b/src/main/java/com/gitblit/wicket/panels/HistoryPanel.java index 21f38388..e1706a09 100644 --- a/src/main/java/com/gitblit/wicket/panels/HistoryPanel.java +++ b/src/main/java/com/gitblit/wicket/panels/HistoryPanel.java @@ -38,8 +38,6 @@ import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.treewalk.TreeWalk;
import org.eclipse.jgit.treewalk.filter.PathFilterGroup;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import com.gitblit.Constants;
import com.gitblit.Keys;
@@ -63,8 +61,6 @@ public class HistoryPanel extends BasePanel { private static final long serialVersionUID = 1L;
- private final Logger log = LoggerFactory.getLogger(getClass());
-
private boolean hasMore;
public HistoryPanel(String wicketId, final String repositoryName, final String objectId,
@@ -84,7 +80,7 @@ public class HistoryPanel extends BasePanel { // commit missing
String msg = MessageFormat.format("Failed to find history of **{0}** *{1}*",
path, objectId);
- log.error(msg + " " + repositoryName);
+ logger().error(msg + " " + repositoryName);
add(new Label("commitHeader", MarkdownUtils.transformMarkdown(msg)).setEscapeModelStrings(false));
add(new Label("breadcrumbs"));
} else {
|