Skip to content

Commit b2b4df5

Browse files
committed
[utbot-logs]
Fixing summarization and instrumented process starting messages. Clarifying log file location at logging design doc.
1 parent a83ac84 commit b2b4df5

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

docs/InterprocessLogging.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@ where places log files. Logs are written by `RollingFileAppender` in `utbot-engi
9595
after file reaches 20MB size. Previous log files are named `utbot-engine-%i.log`. Log file with
9696
maximal index is the last one rolled. For example, `utbot-engine-1.log` is created earlier than `utbot-engine-10.log`.
9797

98+
Default log file directory is `%user_temp%/UtBot/rdEngineProcessLogs`.
99+
In IDEA log following line are print each time engine process started:
100+
```
101+
| UtBot - EngineProcess | Engine process started with PID = 4172
102+
| UtBot - EngineProcess | Engine process log directory - C:\Users\kwx1183156\AppData\Local\Temp\UTBot\rdEngineProcessLogs
103+
| UtBot - EngineProcess | Engine process log file - C:\Users\KWX118~1\AppData\Local\Temp\UTBot\rdEngineProcessLogs\utbot-engine-current.log
104+
```
105+
98106
### Useful
99107
See auxiliary methods to work with logs at `UtRdLogUtil.kt` and `Logging.kt`.
100108
If you want to trace how long execution took - use `org.utbot.common.LoggingKt.bracket`

utbot-instrumentation/src/main/kotlin/org/utbot/instrumentation/process/InstrumentedProcessRunner.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ class InstrumentedProcessRunner {
4545
.directory(directory)
4646

4747
return processBuilder.start().also {
48-
logger.info { "--------Instrumented process started with PID=${it.getPid}--------" }
48+
logger.info {
49+
"------------------------------------------------------------------\n" +
50+
"--------Instrumented process started with PID=${it.getPid}--------\n" +
51+
"------------------------------------------------------------------"
52+
}
4953
}
5054
}
5155

utbot-summary/src/main/kotlin/org/utbot/summary/Summarization.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ import soot.SootMethod
3939
private val logger = KotlinLogging.logger {}
4040

4141
fun Collection<UtMethodTestSet>.summarizeAll(searchDirectory: Path, sourceFile: File?): List<UtMethodTestSet> = logger.info().bracket({
42-
"-----------------------------------------------------------------------------------------" +
43-
"------------------------Summarization started for ${this.size} test cases------------------------" +
44-
"-----------------------------------------------------------------------------------------"
42+
"-------------------------------------------------------------------------------------------------\n" +
43+
"------------------------Summarization started for ${this.size} test cases------------------------\n" +
44+
"-------------------------------------------------------------------------------------------------"
4545
}) {
4646
this.map {
4747
it.summarizeOne(searchDirectory, sourceFile)

0 commit comments

Comments
 (0)