mirror of https://github.com/usbharu/Hideout.git
Merge pull request #227 from usbharu/feature/debug-json
feat: デバッグ用のトレースをオン・オフできるように
This commit is contained in:
commit
a3aaeae8c8
|
@ -21,6 +21,7 @@ import dev.usbharu.httpsignature.verify.HttpSignatureVerifier
|
|||
import dev.usbharu.httpsignature.verify.Signature
|
||||
import dev.usbharu.httpsignature.verify.SignatureHeaderParser
|
||||
import org.slf4j.LoggerFactory
|
||||
import org.springframework.beans.factory.annotation.Value
|
||||
import org.springframework.stereotype.Service
|
||||
|
||||
@Service
|
||||
|
@ -34,6 +35,9 @@ class InboxJobProcessor(
|
|||
private val transaction: Transaction
|
||||
) : JobProcessor<InboxJobParam, InboxJob> {
|
||||
|
||||
@Value("\${hideout.debug.trace-inbox:false}")
|
||||
private var traceJson: Boolean = false
|
||||
|
||||
private suspend fun verifyHttpSignature(
|
||||
httpRequest: HttpRequest,
|
||||
signature: Signature,
|
||||
|
@ -85,7 +89,10 @@ class InboxJobProcessor(
|
|||
val jsonNode = objectMapper.readTree(param.json)
|
||||
|
||||
logger.info("START Process inbox. type: {}", param.type)
|
||||
logger.trace("type: {}\njson: \n{}", param.type, jsonNode.toPrettyString())
|
||||
if (traceJson) {
|
||||
logger.trace("type: {}\njson: \n{}", param.type, jsonNode.toPrettyString())
|
||||
}
|
||||
|
||||
|
||||
val map = objectMapper.readValue<Map<String, List<String>>>(param.headers)
|
||||
|
||||
|
|
Loading…
Reference in New Issue