Log project manager version on startup (#7646)

Looks like that
```
[info] [2023-08-23T13:12:58.119Z] [org.enso.projectmanager.boot.ProjectManager$] Starting Enso Project Manager
Version:    0.0.0-dev
Built with: scala-2.13.11 for GraalVM 17.0.7
Built from: wip/db/fix-dev-version-check* @ 52bc6b8fcf
Built on:   Linux (amd64)
```
This commit is contained in:
Dmitry Bushev 2023-08-24 17:45:22 +01:00 committed by GitHub
parent 7d83b3d7b4
commit c80b8624a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 6 deletions

View File

@ -24,6 +24,7 @@ import zio.{ExitCode, Runtime, Scope, UIO, ZAny, ZIO, ZIOAppArgs, ZIOAppDefault}
import java.io.{EOFException, IOException}
import java.nio.file.{FileAlreadyExistsException, Files, Path, Paths}
import java.util.concurrent.ScheduledThreadPoolExecutor
import scala.concurrent.duration._
import scala.concurrent.{Await, ExecutionContext, ExecutionContextExecutor}
@ -228,7 +229,10 @@ object ProjectManager extends ZIOAppDefault with LazyLogging {
} else {
val verbosity = options.getOptions.count(_ == Cli.option.verbose)
val logMasking = !options.hasOption(Cli.NO_LOG_MASKING)
logger.info("Starting Project Manager...")
logger.info(
"Starting {}",
makeVersionDescription.asString(useJson = false)
)
for {
opts <- parseOpts(options)
profilingLog = opts.profilingPath.map(getSiblingFile(_, ".log"))
@ -278,14 +282,16 @@ object ProjectManager extends ZIOAppDefault with LazyLogging {
private def displayVersion(
useJson: Boolean
): ZIO[ZAny, IOException, ExitCode] = {
val versionDescription = VersionDescription.make(
printLine(makeVersionDescription.asString(useJson)) *>
ZIO.succeed(SuccessExitCode)
}
private def makeVersionDescription: VersionDescription =
VersionDescription.make(
"Enso Project Manager",
includeRuntimeJVMInfo = false,
enableNativeImageOSWorkaround = true
)
printLine(versionDescription.asString(useJson)) *>
ZIO.succeed(SuccessExitCode)
}
private def logServerStartup(): UIO[Unit] =
ZIO.succeed {

View File

@ -115,7 +115,7 @@ object VersionDescription {
| "ref": "${Info.ref}",
| "dirty": ${Info.isDirty},
| "commit": "${Info.commit}",
| $runtimeDescription$parameters
|$runtimeDescription$parameters
|}""".stripMargin
}
}