Skip to content

Commit

Permalink
[SPARK-14185][SQL][MINOR] Make indentation of debug log for generated…
Browse files Browse the repository at this point in the history
… code proper

## What changes were proposed in this pull request?

The indentation of debug log output by `CodeGenerator` is weird.
The first line of the generated code should be put on the next line of the first line of the log message.

```
16/03/28 11:10:24 DEBUG CodeGenerator: /* 001 */
/* 002 */ public java.lang.Object generate(Object[] references) {
/* 003 */   return new SpecificSafeProjection(references);
...
```

After this patch is applied, we get debug log like as follows.

```
16/03/28 10:45:50 DEBUG CodeGenerator:
/* 001 */
/* 002 */ public java.lang.Object generate(Object[] references) {
/* 003 */   return new SpecificSafeProjection(references);
...
```
## How was this patch tested?

Ran some jobs and checked debug logs.

Author: Kousuke Saruta <[email protected]>

Closes apache#11990 from sarutak/fix-debuglog-indentation.
  • Loading branch information
sarutak authored and rxin committed Mar 28, 2016
1 parent 8ef4937 commit aac13fb
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ object CodeGenerator extends Logging {
logDebug({
// Only add extra debugging info to byte code when we are going to print the source code.
evaluator.setDebuggingInformation(true, true, false)
formatted
s"\n$formatted"
})

try {
Expand Down

0 comments on commit aac13fb

Please sign in to comment.