Skip to content

Commit

Permalink
[x2cpg] Fixed version log output (#4627)
Browse files Browse the repository at this point in the history
  • Loading branch information
max-leuthaeuser committed Jun 3, 2024
1 parent 9f2fc59 commit ec2a358
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,10 @@ abstract class X2CpgMain[T <: X2CpgConfig[T], X <: X2CpgFrontend[?]](val cmdLine

private def logVersionAndArgs(args: Array[String]): Unit = {
val frontendName = frontend.getClass.getSimpleName.stripSuffix("$")
val joernVersion = frontend.getClass.getPackage.getImplementationVersion
val logText = s"Executing $frontendName (v$joernVersion) with arguments: ${args.mkString(" ")}"
val joernVersion =
// We only have a proper version there if joern was build using sbt assembly. Otherwise, it might be null.
Option(frontend.getClass.getPackage.getImplementationVersion).map(v => s"v$v").getOrElse("local build")
val logText = s"Executing $frontendName ($joernVersion) with arguments: ${args.mkString(" ")}"
logger.debug(logText)
}

Expand Down

0 comments on commit ec2a358

Please sign in to comment.