Skip to content

Commit f461d48

Browse files
committed
chore: logging
1 parent 527df3e commit f461d48

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

src/main/kotlin/spp/cli/PlatformCLI.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import org.bouncycastle.openssl.PEMKeyPair
3636
import org.bouncycastle.openssl.PEMParser
3737
import org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter
3838
import org.bouncycastle.util.encoders.Hex
39+
import org.slf4j.LoggerFactory
3940
import java.io.File
4041
import java.io.StringReader
4142
import java.security.SecureRandom
@@ -50,6 +51,7 @@ import javax.net.ssl.X509TrustManager
5051

5152
object PlatformCLI : CliktCommand(name = "spp-cli", allowMultipleSubcommands = true) {
5253

54+
private val log = LoggerFactory.getLogger(PlatformCLI::class.java)
5355
val verbose by option("-v", "--verbose", help = "Enable verbose mode").flag()
5456
val platformHost: String by option("-p", "--platform", help = "Source++ platform host")
5557
.default(
@@ -84,6 +86,7 @@ object PlatformCLI : CliktCommand(name = "spp-cli", allowMultipleSubcommands = t
8486
} else {
8587
"https://$platformHost"
8688
}
89+
log.info("Connecting to Source++ platform at $serverUrl")
8790

8891
val httpClient = if (certFingerprint != null) {
8992
OkHttpClient().newBuilder()

src/main/kotlin/spp/cli/commands/developer/instrument/AddBreakpoint.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import com.github.ajalt.clikt.parameters.types.enum
2727
import com.github.ajalt.clikt.parameters.types.int
2828
import com.github.ajalt.clikt.parameters.types.long
2929
import kotlinx.coroutines.runBlocking
30+
import org.slf4j.LoggerFactory
3031
import spp.cli.PlatformCLI.apolloClient
3132
import spp.cli.protocol.instrument.AddLiveBreakpointMutation
3233
import spp.cli.protocol.instrument.adapter.AddLiveBreakpointMutation_ResponseAdapter.AddLiveBreakpoint
@@ -39,6 +40,7 @@ import spp.protocol.instrument.throttle.ThrottleStep
3940

4041
class AddBreakpoint : CliktCommand(name = "breakpoint", help = "Add a live breakpoint instrument") {
4142

43+
private val log = LoggerFactory.getLogger(AddBreakpoint::class.java)
4244
val source by argument(help = "Qualified class name")
4345
val line by argument(help = "Line number").int()
4446
val id by option("-id", "-i", help = "Breakpoint identifier")
@@ -62,6 +64,8 @@ class AddBreakpoint : CliktCommand(name = "breakpoint", help = "Add a live break
6264
),
6365
id = Optional.presentIfNotNull(id)
6466
)
67+
log.info("Sending request: {}", input)
68+
6569
val response = try {
6670
apolloClient.mutation(AddLiveBreakpointMutation(input)).execute()
6771
} catch (e: Exception) {

src/test/kotlin/integration/BatchLiveInstrumentCLI.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class BatchLiveInstrumentCLI : CLIIntegrationTest() {
3535
//100 live bps
3636
val addedLiveBps = mutableListOf<LiveInstrument>()
3737
for (i in 0..99) {
38+
log.info("Adding live breakpoint: bp-$i")
3839
Main.main(
3940
arrayOf(
4041
"-v",

0 commit comments

Comments
 (0)