Skip to content

Commit 9dc1ace

Browse files
authored
Merge pull request #6 from defold/fix-missing-bob-verbose
Fix for using missing functionality in bob
2 parents b955b9a + 0326ef4 commit 9dc1ace

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

lua-preprocessor/pluginsrc/com/defold/extension/pipeline/LuaPreprocessor.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import java.io.OutputStream;
77
import java.util.List;
88
import java.util.ArrayList;
9+
import java.util.logging.Logger;
910
import java.nio.file.Files;
1011
import java.nio.file.StandardCopyOption;
1112

@@ -27,17 +28,18 @@
2728
import com.dynamo.bob.pipeline.antlr.LuaPreProcBaseListener;
2829

2930
public class LuaPreprocessor implements ILuaPreprocessor {
31+
private static Logger logger = Logger.getLogger(LuaPreprocessor.class.getName());
3032

31-
private static StringBuffer parsedBuffer = null;
32-
private static Boolean hasChanges;
33-
private static String errorMessage;
34-
private static int currentBuildVariant;
33+
private static StringBuffer parsedBuffer = null;
34+
private static Boolean hasChanges;
35+
private static String errorMessage;
36+
private static int currentBuildVariant;
3537

3638
// replace the token with an empty string
3739
private static void removeToken(Token token) {
3840
LuaPreprocessor.hasChanges = true;
3941
int from = token.getStartIndex();
40-
Bob.verbose("removeToken %s", token.getText());
42+
logger.fine("removeToken " + token.getText());
4143
int to = from + token.getText().length() - 1;
4244
for(int i = from; i <= to; i++) {
4345
parsedBuffer.replace(i, i + 1, " ");
@@ -92,7 +94,7 @@ public void syntaxError(Recognizer<?, ?> recognizer, Object offendingSymbol, int
9294
}
9395

9496
if (LuaPreprocessor.hasChanges) {
95-
Bob.verbose("LuaPreprocessor: apply %s", buildVariant);
97+
logger.fine("LuaPreprocessor: apply " + buildVariant);
9698
return parsedBuffer.toString();
9799
}
98100

main/test.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ local M = {
33

44
function M.greet(name)
55
--#IF RELEASE
6-
print("Hello " .. name)
6+
-- use io.stdout as that will still write to stdout in release mode
7+
io.stdout:write("Hello " .. name .. "\n")
78
--#ELSE
8-
print("More debug info:"..name)
9+
print("More debug info: " .. name)
910
--#ENDIF
1011

1112
end

0 commit comments

Comments
 (0)