Skip to content

Commit

Permalink
log httpServer
Browse files Browse the repository at this point in the history
  • Loading branch information
gmuth committed Feb 20, 2024
1 parent 46e9e3c commit b4903ee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/kotlin/de/gmuth/ipp/core/IppMessage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ abstract class IppMessage() {
)

@JvmOverloads
fun log(logger: Logger, level: Level = INFO, prefix: String = "") {
open fun log(logger: Logger, level: Level = INFO, prefix: String = "") {
if (rawBytes != null) logger.log(level) { "${prefix}${rawBytes!!.size} raw ipp bytes" }
logger.log(level) { "${prefix}version = $version" }
logger.log(level) { "${prefix}$codeDescription" }
Expand Down
7 changes: 7 additions & 0 deletions src/main/kotlin/de/gmuth/ipp/core/IppResponse.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ package de.gmuth.ipp.core

import de.gmuth.ipp.core.IppTag.Unsupported
import java.nio.charset.Charset
import java.util.logging.Level
import java.util.logging.Logger

class IppResponse : IppMessage {

Expand Down Expand Up @@ -40,4 +42,9 @@ class IppResponse : IppMessage {
) : super(version, requestId, charset, naturalLanguage) {
code = status.code
}

override fun log(logger: Logger, level: Level, prefix: String) {
httpServer?.let { logger.log(level) { "${prefix}httpServer = $it" } }
super.log(logger, level, prefix)
}
}

0 comments on commit b4903ee

Please sign in to comment.