Skip to content

Commit

Permalink
Add deprecation output for sandbox classic (digital-asset#11119)
Browse files Browse the repository at this point in the history
changelog_begin
changelog_end
  • Loading branch information
rautenrieth-da authored Oct 5, 2021
1 parent ac5c52d commit cfcdc13
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,28 @@ package com.daml.platform.sandbox

import com.daml.ledger.resources.ResourceContext
import com.daml.cliopts.GlobalLogLevel
import com.daml.logging.ContextualizedLogger
import com.daml.logging.LoggingContext.newLoggingContext
import com.daml.platform.sandbox.config.SandboxConfig
import com.daml.resources.ProgramResource

object SandboxMain {

private val logger = ContextualizedLogger.get(this.getClass)

def main(args: Array[String]): Unit =
new ProgramResource({
val config: SandboxConfig = Cli.parse(args).getOrElse(sys.exit(1))
config.logLevel.foreach(GlobalLogLevel.set("Sandbox"))

// Point users to non-deprecated ledgers
config.jdbcUrl.foreach(_ =>
newLoggingContext { implicit loggingContext =>
logger.info(
"Sandbox classic with persistence is deprecated. Use the Daml Driver for PostgreSQL if you need persistence."
)
}
)
SandboxServer.owner(Name, config)
}).run(ResourceContext.apply)

Expand Down

0 comments on commit cfcdc13

Please sign in to comment.