-
Notifications
You must be signed in to change notification settings - Fork 1
/
TailLogs.kt
42 lines (36 loc) · 1.29 KB
/
TailLogs.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package spp.demo.command
import org.slf4j.LoggerFactory
/**
* This class is used to demonstrate the `Tail Logs` command.
*
* **Usage:**
* Open the Source++ Command Palette with `Ctrl+Shift+S` and search for `Tail Logs`.
*
* **Command source code:**
* [Tail Logs](https://github.com/sourceplusplus/jetbrains-commander/blob/master/resources/.spp/plugins/tail-logs/plugin.kts)
*/
class TailLogs {
private val log = LoggerFactory.getLogger(TailLogs::class.java)
/**
* Execute the `Tail Logs` command with your cursor on line 22 to see logs for this whole class.
*/
fun tailClassLogs() {
Math.random()
}
/**
* Execute the `Tail Logs` command with your cursor on line 29 to see logs for this whole method.
*/
fun tailMethodLogs() {
val randomNumber1 = Math.random()
val randomNumber2 = Math.random()
log.info("Tailing method logs. First random number: {}", randomNumber1)
log.info("Tailing method logs. Second random number: {}", randomNumber2)
}
/**
* Execute the `Tail Logs` command with your cursor on line 40 to see logs for that specific statement.
*/
fun tailStatementLogs() {
val randomNumber = Math.random()
log.info("Tailing statement logs. Random number: {}", randomNumber)
}
}