diff src/org/tmatesoft/hg/repo/HgRemoteRepository.java @ 456:909306e412e2

Refactor LogFacility and SessionContext, better API for both
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Mon, 18 Jun 2012 16:54:00 +0200
parents 2a08466838d3
children b3c16d1aede0
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/repo/HgRemoteRepository.java	Wed Jun 13 21:07:39 2012 +0200
+++ b/src/org/tmatesoft/hg/repo/HgRemoteRepository.java	Mon Jun 18 16:54:00 2012 +0200
@@ -16,6 +16,8 @@
  */
 package org.tmatesoft.hg.repo;
 
+import static org.tmatesoft.hg.util.LogFacility.Severity.Info;
+
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileOutputStream;
@@ -55,6 +57,7 @@
 import org.tmatesoft.hg.core.HgRepositoryNotFoundException;
 import org.tmatesoft.hg.core.Nodeid;
 import org.tmatesoft.hg.core.SessionContext;
+import org.tmatesoft.hg.internal.PropertyMarshal;
 
 /**
  * WORK IN PROGRESS, DO NOT USE
@@ -80,8 +83,7 @@
 		}
 		this.url = url;
 		sessionContext = ctx;
-		Object debugProp = ctx.getProperty("hg4j.remote.debug", false);
-		debug = debugProp instanceof Boolean ? ((Boolean) debugProp).booleanValue() : Boolean.parseBoolean(String.valueOf(debugProp));
+		debug = new PropertyMarshal(ctx).getBoolean("hg4j.remote.debug", false);
 		if ("https".equals(url.getProtocol())) {
 			try {
 				sslContext = SSLContext.getInstance("SSL");
@@ -116,7 +118,7 @@
 				ai = tempNode.get("xxx", null);
 				tempNode.removeNode();
 			} catch (BackingStoreException ex) {
-				sessionContext.getLog().info(getClass(), ex, null);
+				sessionContext.getLog().dump(getClass(), Info, ex, null);
 				// IGNORE
 			}
 			authInfo = ai;