Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Remove console logging
Browse files Browse the repository at this point in the history
  • Loading branch information
seanf committed Dec 18, 2012
1 parent 1e8be38 commit d5884ca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
Expand Up @@ -41,7 +41,7 @@ private Resource getTemplate()
InputSource inputSource = new InputSource(new File(testDir, "pot/RPM.pot").toURI().toString());
inputSource.setEncoding("utf8");

System.out.println("parsing template");
log.debug("parsing template");
Resource doc = poReader.extractTemplate(inputSource, LocaleId.EN_US, "doc1");
assertThat(doc.getTextFlows().size(), is(137));
return doc;
Expand All @@ -55,7 +55,7 @@ public void extractTarget() throws IOException, JAXBException
String locale = "ja-JP";
inputSource = new InputSource(new File(testDir, locale + "/RPM.po").toURI().toString());
inputSource.setEncoding("utf8");
System.out.println("extracting target: " + locale);
log.debug("extracting target: " + locale);
TranslationsResource targetDoc = poReader.extractTarget(inputSource);
List<TextFlowTarget> textFlowTargets = targetDoc.getTextFlowTargets();
assertThat(textFlowTargets.size(), is(137));
Expand All @@ -66,14 +66,14 @@ public void extractTarget() throws IOException, JAXBException
Marshaller m = jaxbContext.createMarshaller();
m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);

System.out.println("marshalling source doc");
log.debug("marshalling source doc");
{
StringWriter writer = new StringWriter();
m.marshal(doc, writer);
log.debug("{}", writer);
}

System.out.println("marshalling target doc");
log.debug("marshalling target doc");
{
StringWriter writer = new StringWriter();
m.marshal(targetDoc, writer);
Expand Down Expand Up @@ -113,7 +113,7 @@ public void extractInvalidTarget() throws IOException, JAXBException
String locale = "ja-JP";
InputSource inputSource = new InputSource(new File(testDir, locale + "/invalid.po").toURI().toString());
inputSource.setEncoding("utf8");
System.out.println("extracting target: " + locale);
log.debug("extracting target: " + locale);

poReader.extractTarget(inputSource);
}
Expand Down
Expand Up @@ -13,6 +13,8 @@
import java.util.Map;

import org.fedorahosted.openprops.Properties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.zanata.common.ContentState;
import org.zanata.rest.dto.extensions.comment.SimpleComment;
import org.zanata.rest.dto.resource.Resource;
Expand All @@ -22,11 +24,7 @@

public class PropWriter
{

private static void logVerbose(String msg)
{
System.out.println(msg);
}
private static final Logger log = LoggerFactory.getLogger(PropWriter.class);

private static void makeParentDirs(File f)
{
Expand Down Expand Up @@ -58,7 +56,7 @@ private static void write(final Resource doc, final File baseDir, boolean utf8)
File baseFile = new File(baseDir, doc.getName() + ".properties");
makeParentDirs(baseFile);

logVerbose("Creating base file " + baseFile);
log.debug("Creating base file " + baseFile);
Properties props = new Properties();
for (TextFlow textFlow : doc.getTextFlows())
{
Expand Down Expand Up @@ -119,7 +117,7 @@ private static void write(

File langFile = new File(baseDir, bundleName + "_" + locale + ".properties");
makeParentDirs(langFile);
logVerbose("Creating target file " + langFile);
log.debug("Creating target file " + langFile);
storeProps(targetProp, langFile, utf8);
}

Expand Down

0 comments on commit d5884ca

Please sign in to comment.