gitweb on Svarog
projekti pod git sistemom za održavanje verzija -- projects under the git version control system
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2fa0619)
raw | patch | inline | side by side (parent: 2fa0619)
author | Doni Pracner <quinnuendo@gmail.com> | |
Tue, 17 Jul 2018 23:50:47 +0000 (01:50 +0200) | ||
committer | Doni Pracner <quinnuendo@gmail.com> | |
Tue, 17 Jul 2018 23:50:47 +0000 (01:50 +0200) |
src/com/quemaster/transformations/TransMessages.java | patch | blob | history | |
src/com/quemaster/transformations/mjc2wsl/Mjc2wsl.java | patch | blob | history |
diff --git a/src/com/quemaster/transformations/TransMessages.java b/src/com/quemaster/transformations/TransMessages.java
index 042612fe05829f7bb1d04ea7c8d22c257d249944..bd27009bb8d29ec0496facde9b43840d938ab34d 100644 (file)
package com.quemaster.transformations;
/*
- Copyright (C) 2014 Doni Pracner
+ Copyright (C) 2014, 2018 Doni Pracner
This file is part of mjc2wsl.
private int[] messageCounters;
public static final int M_DEB = 0;
public static final int M_WAR = 1;
- public static final int M_ERR = 2;
- public static final int M_QUIET = 3;
+ public static final int M_NOTIFY = 2;
+ public static final int M_ERR = 5;
+ public static final int M_QUIET = 10;
private PrintStream outStream = System.out;
public TransMessages() {
messageCounters[level]++;
}
+ public void message(String string) {
+ message(string,M_NOTIFY);
+ }
+
public int getLevelMessageCount(int level){
if (level < messageCounters.length){
return messageCounters[level];
}
public void printMessageCounters(PrintStream out){
- out.println("total errors:"+messageCounters[TransMessages.M_ERR]+" warnings:"+messageCounters[TransMessages.M_WAR]);
+ if (printLevel < M_QUIET)
+ out.println("total errors:" + messageCounters[TransMessages.M_ERR]
+ + " warnings:" + messageCounters[TransMessages.M_WAR]
+ + " notifications:" + messageCounters[TransMessages.M_NOTIFY]
+ );
}
public void printMessageCounters(){
public void setPrintLevel(int printLevel) {
this.printLevel = printLevel;
}
+
}
\ No newline at end of file
diff --git a/src/com/quemaster/transformations/mjc2wsl/Mjc2wsl.java b/src/com/quemaster/transformations/mjc2wsl/Mjc2wsl.java
index 6c3836ee58839aa53d1448c1a8fa1f555cc4dada..d3f72970be9a71651f5ec28e5471a6e979726407 100644 (file)
int op = mjInput.get();
while (op >= 0) {
+ messages.message("Processing "+mjInput.describeOpCode(op)+ " at " + mjInput.getCounter(), TransMessages.M_DEB);
prl(" a" + mjInput.getCounter() + " ==");
if (originalInComments)
prl(createComment(mjInput.describeOpCode(op), C_OC));
System.err.println("error in opening out file:");
e.printStackTrace();
}
+ if (i + 2 < args.length) {
+ messages.message("additional parameters ignored, starting from:'"+args[i+2]+"'", TransMessages.M_ERR);
+ }
}
if (out == null) {
// if not set to screen, or a file, make a default filename
}
long mili = Calendar.getInstance().getTimeInMillis()
- now.getTimeInMillis();
- System.out.println("conversion time:" + mili + " ms");
+ messages.message("conversion time:" + mili + " ms");
messages.printMessageCounters();
out.close();
}