changed log/debugging messages to use stderr instead of stdout
parent
e62a17bc2b
commit
503a5201d5
|
@ -29,7 +29,7 @@ public class MagicMain {
|
|||
} else {
|
||||
gamePath=System.getProperty("user.home")+File.separatorChar+GAME_PATH;
|
||||
}
|
||||
System.out.println("Data folder : "+gamePath);
|
||||
System.err.println("Data folder : "+gamePath);
|
||||
}
|
||||
|
||||
public static void main(String args[]) {
|
||||
|
|
|
@ -126,10 +126,10 @@ public class ArtificialWorker {
|
|||
aiChoiceResults.aiScore=ArtificialScore.MAXIMUM_DEPTH_EXCEEDED_SCORE;
|
||||
} catch (final Exception ex) {
|
||||
aiChoiceResults.aiScore=ArtificialScore.INVALID_SCORE;
|
||||
System.out.println(MagicGameReport.buildReport(game));
|
||||
System.err.println(MagicGameReport.buildReport(game));
|
||||
ex.printStackTrace();
|
||||
}
|
||||
aiChoiceResults.gameCount=gameCount;
|
||||
game.undoAllActions();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,9 +34,8 @@ public class ArtificialWorkerPool {
|
|||
}
|
||||
|
||||
private static void logMessage(final String message) {
|
||||
|
||||
if (LOGGING) {
|
||||
System.out.println(message);
|
||||
System.err.println(message);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -203,4 +202,4 @@ public class ArtificialWorkerPool {
|
|||
releaseWorker(worker,aiChoiceResults);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,19 +79,19 @@ public class MCTSAI implements MagicAI {
|
|||
|
||||
private void log(final String message) {
|
||||
if (LOGGING) {
|
||||
System.out.println(message);
|
||||
System.err.println(message);
|
||||
}
|
||||
}
|
||||
|
||||
private void logi(final int num) {
|
||||
if (LOGGING) {
|
||||
System.out.print(num);
|
||||
System.err.print(num);
|
||||
}
|
||||
}
|
||||
|
||||
private void logc(final char message) {
|
||||
if (LOGGING) {
|
||||
System.out.print(message);
|
||||
System.err.print(message);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ public class RandomAI implements MagicAI {
|
|||
|
||||
private void log(final String message) {
|
||||
if (LOGGING) {
|
||||
System.out.println(message);
|
||||
System.err.println(message);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -174,7 +174,7 @@ public class CardDefinitions {
|
|||
addDefinitions(TokenCardDefinitions.TOKEN_CARDS);
|
||||
addDefinition(MagicCardDefinition.EMPTY);
|
||||
|
||||
System.out.println(getNumberOfCards()+" card definitions");
|
||||
System.err.println(getNumberOfCards()+" card definitions");
|
||||
}
|
||||
|
||||
public int getNumberOfCards() {
|
||||
|
|
|
@ -103,10 +103,10 @@ public class CubeDefinitions {
|
|||
}
|
||||
}
|
||||
|
||||
System.out.println(cubeDefinitions.size()+" cube definitions");
|
||||
System.err.println(cubeDefinitions.size()+" cube definitions");
|
||||
for (final MagicCubeDefinition cubeDefinition : cubeDefinitions) {
|
||||
|
||||
System.out.println("Cube "+cubeDefinition.getName()+" : "+cubeDefinition.size()+" cards");
|
||||
System.err.println("Cube "+cubeDefinition.getName()+" : "+cubeDefinition.size()+" cards");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -114,4 +114,4 @@ public class CubeDefinitions {
|
|||
|
||||
return INSTANCE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -306,7 +306,7 @@ public class GeneralConfig {
|
|||
final Properties properties=new Properties();
|
||||
save(properties);
|
||||
properties.store(new FileOutputStream(getConfigFile()),"General configuration");
|
||||
System.out.println("Saved general config");
|
||||
System.err.println("Saved general config");
|
||||
} catch (final IOException ex) {
|
||||
System.err.println("ERROR: unable to save general config");
|
||||
}
|
||||
|
|
|
@ -41,9 +41,6 @@ public class ManaActivationDefinitions {
|
|||
}
|
||||
|
||||
public static void addManaActivations() {
|
||||
|
||||
System.out.println("Adding mana activations...");
|
||||
|
||||
// Vivid lands.
|
||||
addVividActivations("Vivid Crag",MagicManaType.Red);
|
||||
addVividActivations("Vivid Creek",MagicManaType.Blue);
|
||||
|
@ -73,5 +70,7 @@ public class ManaActivationDefinitions {
|
|||
addCreatureActivations("Steward of Valeron",new MagicManaType[]{MagicManaType.Colorless,MagicManaType.Green});
|
||||
addCreatureActivations("Vine Trellis",new MagicManaType[]{MagicManaType.Colorless,MagicManaType.Green});
|
||||
addCreatureActivations("Plague Myr",new MagicManaType[]{MagicManaType.Colorless});
|
||||
|
||||
System.err.println("Added 20 mana activations");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -171,7 +171,7 @@ public class TournamentConfig {
|
|||
final Properties properties=new Properties();
|
||||
properties.load(new FileInputStream(getConfigFile()));
|
||||
load(properties);
|
||||
System.out.println("Loaded tournament config");
|
||||
System.err.println("Loaded tournament config");
|
||||
} catch (final IOException ex) {
|
||||
System.err.println("ERROR: unable to load tournament config");
|
||||
}
|
||||
|
@ -194,7 +194,7 @@ public class TournamentConfig {
|
|||
final Properties properties=new Properties();
|
||||
save(properties);
|
||||
properties.store(new FileOutputStream(getConfigFile()),"Tournament configuration");
|
||||
System.out.println("Saved tournament config");
|
||||
System.err.println("Saved tournament config");
|
||||
} catch (final IOException ex) {
|
||||
System.err.println("ERROR: unable to save tournament config");
|
||||
}
|
||||
|
|
|
@ -104,17 +104,14 @@ public class MagicActivationMap extends HashMap<MagicActivation,SortedSet<MagicS
|
|||
}
|
||||
|
||||
public void print() {
|
||||
|
||||
System.out.println(getClass().getName());
|
||||
System.err.println(getClass().getName());
|
||||
for (final MagicActivation activation : activations) {
|
||||
|
||||
System.out.print(activation.getClass().getName()+" :");
|
||||
System.err.print(activation.getClass().getName()+" :");
|
||||
for (final MagicSource source : get(activation)) {
|
||||
|
||||
System.out.print(" "+source.getName());
|
||||
System.err.print(" "+source.getName());
|
||||
}
|
||||
System.out.println();
|
||||
System.err.println();
|
||||
}
|
||||
System.out.println();
|
||||
System.err.println();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ public class DelayedViewersThread extends Thread {
|
|||
}
|
||||
wait(100);
|
||||
} catch (final InterruptedException ex) {
|
||||
System.out.println("Interrupted : "+ex.getMessage());
|
||||
System.err.println("Interrupted : "+ex.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -56,4 +56,4 @@ public class DelayedViewersThread extends Thread {
|
|||
|
||||
return VIEWER_THREAD;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,6 @@ public class GameControllerThread extends Thread {
|
|||
public void run() {
|
||||
|
||||
controller.runGame();
|
||||
System.out.println("Stopping game...");
|
||||
System.err.println("Stopping game...");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ public class ImageViewer extends JPanel implements DelayedViewer {
|
|||
if (imagePathFile.exists()) {
|
||||
imageFiles=new ArrayList<File>();
|
||||
scanFiles(imageFiles,imagePathFile);
|
||||
System.out.println("Found "+imageFiles.size()+" user images.");
|
||||
System.err.println("Found "+imageFiles.size()+" user images.");
|
||||
} else {
|
||||
imageFiles=Collections.emptyList();
|
||||
}
|
||||
|
@ -192,4 +192,4 @@ public class ImageViewer extends JPanel implements DelayedViewer {
|
|||
g.drawRect(0,0,getWidth()-1,viewerHeight-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue