Skip to content

Commit 56e81e6

Browse files
committed
making output less verbose
1 parent 40b610c commit 56e81e6

File tree

14 files changed

+76
-99
lines changed

14 files changed

+76
-99
lines changed

biojava-alignment/src/test/java/org/biojava/nbio/alignment/NeedlemanWunschTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public void testComplex() throws Exception {
7777

7878
PairwiseSequenceAligner<DNASequence, NucleotideCompound> aligner = Alignments.getPairwiseAligner(a, b, Alignments.PairwiseSequenceAlignerType.GLOBAL, new SimpleGapPenalty(gop, gep), mx);
7979
SequencePair<DNASequence, NucleotideCompound> pair = aligner.getPair();
80-
System.out.println(pair); // prints the alignment above
80+
8181

8282
int nMatches = "--CGTATATATCGCGCGCGCGATATATATATCT-TCTCTAAAAAAA".length() - 2 - 4;
8383
double expectedScore = nMatches * match
Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<Configuration status="WARN">
3-
<Appenders>
2+
<configuration status="WARN">
3+
<appenders>
44
<Console name="Console" target="SYSTEM_ERR">
55
<PatternLayout pattern="%d{HH:mm:ss} [%t] %-5level %logger{36} - %msg%n"/>
66
</Console>
7-
</Appenders>
8-
<Loggers>
9-
<!--
10-
<Logger name="org.biojava.nbio.core.sequence.loader.GenbankProxySequenceReader" level="debug">
11-
<AppenderRef ref="Console"/>
12-
</Logger>
13-
-->
14-
<!--
15-
<Logger name="org.biojava.nbio.core.sequence.location.InsdcParserTest" level="debug" />
16-
-->
17-
18-
<Root level="warn">
19-
<AppenderRef ref="Console"/>
20-
</Root>
21-
</Loggers>
22-
</Configuration>
7+
</appenders>
8+
<loggers>
9+
<root level="warn">
10+
<appender-ref ref="Console"/>
11+
</root>
12+
</loggers>
13+
</configuration>
Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<Configuration status="WARN">
3-
<Appenders>
2+
<configuration status="WARN">
3+
<appenders>
44
<Console name="Console" target="SYSTEM_ERR">
55
<PatternLayout pattern="%d{HH:mm:ss} [%t] %-5level %logger{36} - %msg%n"/>
66
</Console>
7-
</Appenders>
8-
<Loggers>
9-
<!--
10-
<Logger name="org.biojava.nbio.core.sequence.loader.GenbankProxySequenceReader" level="debug">
11-
<AppenderRef ref="Console"/>
12-
</Logger>
13-
-->
7+
</appenders>
8+
<loggers>
149
<root level="warn">
15-
<AppenderRef ref="Console"/>
16-
</Root>
17-
</Loggers>
18-
</Configuration>
10+
<appender-ref ref="Console"/>
11+
</root>
12+
</loggers>
13+
</configuration>
Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<Configuration status="WARN">
3-
<Appenders>
2+
<configuration status="WARN">
3+
<appenders>
44
<Console name="Console" target="SYSTEM_ERR">
55
<PatternLayout pattern="%d{HH:mm:ss} [%t] %-5level %logger{36} - %msg%n"/>
66
</Console>
7-
</Appenders>
8-
<Loggers>
9-
<!--
10-
<Logger name="org.biojava.nbio.core.sequence.loader.GenbankProxySequenceReader" level="debug">
11-
<AppenderRef ref="Console"/>
12-
</Logger>
13-
-->
7+
</appenders>
8+
<loggers>
149
<root level="warn">
15-
<AppenderRef ref="Console"/>
16-
</Root>
17-
</Loggers>
18-
</Configuration>
10+
<appender-ref ref="Console"/>
11+
</root>
12+
</loggers>
13+
</configuration>
Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<Configuration status="WARN">
3-
<Appenders>
4-
<Console name="Console" target="SYSTEM_ERR">
2+
<configuration status="WARN">
3+
<appenders>
4+
<console name="Console" target="SYSTEM_ERR">
55
<PatternLayout pattern="%d{HH:mm:ss} [%t] %-5level %logger{36} - %msg%n"/>
6-
</Console>
7-
</Appenders>
8-
<Loggers>
9-
<!--
10-
<Logger name="org.biojava.nbio.core.sequence.loader.GenbankProxySequenceReader" level="debug">
11-
<AppenderRef ref="Console"/>
12-
</Logger>
13-
-->
6+
</console>
7+
</appenders>
8+
<loggers>
149
<root level="warn">
15-
<AppenderRef ref="Console"/>
16-
</Root>
17-
</Loggers>
18-
</Configuration>
10+
<appender-ref ref="Console"/>
11+
</root>
12+
</loggers>
13+
</configuration>

biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/UserConfiguration.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import java.io.IOException;
3232
import java.io.PrintWriter;
3333
import java.util.Map;
34+
import java.util.concurrent.atomic.AtomicBoolean;
3435

3536

3637
/** A container to persist config to the file system
@@ -61,6 +62,7 @@ public class UserConfiguration
6162

6263
private String fileFormat;
6364

65+
private static AtomicBoolean warningShown = new AtomicBoolean(false);
6466

6567

6668
/**
@@ -148,9 +150,15 @@ private String initPdbFilePath() {
148150

149151
} else {
150152
path = System.getProperty(TMP_DIR);
151-
logger.warn("Could not read dir from system property {} or environment variable {}, "
152-
+ "using system's temp directory {}",
153-
propertyName, propertyName, path);
153+
154+
if ( ! warningShown.get()) {
155+
156+
logger.warn("Could not read dir from system property {} or environment variable {}, "
157+
+ "using system's temp directory {}",
158+
propertyName, propertyName, path);
159+
160+
warningShown.set(true);
161+
}
154162

155163
System.setProperty(propertyName,path);
156164
}

biojava-structure/src/main/java/org/biojava/nbio/structure/io/PDBFileParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1833,7 +1833,7 @@ private void pdb_ATOM_Handler(String line) {
18331833
// parse element from element field
18341834
String elementSymbol = line.substring(76, 78).trim();
18351835
if (elementSymbol.isEmpty()) {
1836-
logger.warn("Element column was empty for atom {} {}. Assigning atom element "
1836+
logger.info("Element column was empty for atom {} {}. Assigning atom element "
18371837
+ "from Chemical Component Dictionary information", fullname.trim(), pdbnumber);
18381838
} else {
18391839

biojava-structure/src/test/java/org/biojava/nbio/structure/TestEntityHeuristics.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -240,15 +240,6 @@ private Structure getStructure(String fileName, boolean setAlignSeqRes) throws I
240240

241241
Structure s = pdbpars.parsePDBFile(inStream) ;
242242

243-
System.out.println("Entities for file: "+fileName);
244-
for (EntityInfo ent:s.getEntityInfos()) {
245-
System.out.print(ent.getRepresentative().getName()+":");
246-
for (Chain c:ent.getChains()) {
247-
System.out.print(" "+c.getName());
248-
}
249-
System.out.println();
250-
}
251-
252243
return s;
253244
}
254245

biojava-structure/src/test/java/org/biojava/nbio/structure/TestStructureCrossReferences.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public void testCrossReferencesMmCif() throws IOException, StructureException {
6060

6161
Structure structure = StructureIO.getStructure(PDBCODE1);
6262

63-
System.out.println("Testing references in mmCIF loading with NO alignSeqRes");
63+
//System.out.println("Testing references in mmCIF loading with NO alignSeqRes");
6464
doFullTest(structure, emptySeqRes);
6565

6666
structure = StructureIO.getStructure(PDBCODE2); // an NMR entry with 2 chains
@@ -83,7 +83,7 @@ public void testCrossReferencesMmCifAlignSeqRes() throws IOException, StructureE
8383

8484
Structure structure = StructureIO.getStructure(PDBCODE1);
8585

86-
System.out.println("Testing references in mmCIF loading with alignSeqRes");
86+
//System.out.println("Testing references in mmCIF loading with alignSeqRes");
8787
doFullTest(structure, emptySeqRes);
8888

8989
structure = StructureIO.getStructure(PDBCODE2); // an NMR entry with 2 chains
@@ -127,7 +127,7 @@ public void testCrossReferencesPdbAlignSeqRes() throws IOException, StructureExc
127127

128128
StructureIO.setAtomCache(cache);
129129

130-
System.out.println("Testing references in PDB loading with alignSeqRes");
130+
//System.out.println("Testing references in PDB loading with alignSeqRes");
131131
Structure structure = StructureIO.getStructure(PDBCODE1);
132132

133133
doFullTest(structure, emptySeqRes);
@@ -145,7 +145,7 @@ public void testCrossReferencesRawFile() throws IOException, StructureException
145145

146146
private void doFullTest(Structure structure, boolean emptySeqRes) throws StructureException {
147147

148-
System.out.println("Testing references in original structure");
148+
//System.out.println("Testing references in original structure");
149149

150150
testStructureRefs(structure, emptySeqRes);
151151
logger.debug("Original structure mem hashCode: {}",System.identityHashCode(structure));
@@ -156,26 +156,26 @@ private void doFullTest(Structure structure, boolean emptySeqRes) throws Structu
156156

157157
assertNotSame(structure, structureCopy);
158158

159-
System.out.println("Testing references in cloned structure");
159+
//System.out.println("Testing references in cloned structure");
160160

161161
testStructureRefs(structureCopy, emptySeqRes);
162162

163163
logger.debug("Original structure mem hashCode after cloning: {}",System.identityHashCode(structure));
164164

165165

166-
System.out.println("Testing references in original structure after having cloned it");
166+
//System.out.println("Testing references in original structure after having cloned it");
167167
// we test again the original after cloning it, perhaps some references were mixed while cloning
168168
// there is a bug in ChainImpl.clone() that mixes them up!
169169
testStructureRefs(structure, emptySeqRes);
170170

171171

172-
System.out.println("Testing references of chain clones");
172+
//System.out.println("Testing references of chain clones");
173173
for (Chain c:structure.getChains()) {
174174
Chain clonedChain = (Chain) c.clone();
175175
testChainRefs(clonedChain, emptySeqRes);
176176
}
177177

178-
System.out.println("Testing references in atom arrays");
178+
//System.out.println("Testing references in atom arrays");
179179
for (Chain c:structure.getChains()) {
180180
Atom[] atomArray = StructureTools.getAllAtomArray(c);
181181
testAtomArrayRefs(atomArray, c);
@@ -190,7 +190,7 @@ private void doFullTest(Structure structure, boolean emptySeqRes) throws Structu
190190
testInterfaceRefs(structure, interf);
191191
}
192192

193-
System.out.println("Testing references in original structure after getUniqueInterfaces");
193+
//System.out.println("Testing references in original structure after getUniqueInterfaces");
194194
testStructureRefs(structure, emptySeqRes);
195195
}
196196

biojava-structure/src/test/java/org/biojava/nbio/structure/align/multiple/util/TestMultipleAlignmentWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public void testTransformMatrices2() throws IOException{
220220

221221
String result = MultipleAlignmentWriter.
222222
toTransformMatrices(alignment2);
223-
System.out.println(result);
223+
224224

225225
FileReader file = new FileReader(
226226
"src/test/resources/testMSTA2.transforms");

0 commit comments

Comments
 (0)