+str #15349 Add debug logging setting

This commit is contained in:
Patrik Nordwall 2015-01-27 13:36:13 +01:00
parent 03abd197fc
commit aa5af8e8ad
9 changed files with 33 additions and 12 deletions

View file

@ -183,7 +183,8 @@ object MaterializerSettings {
config.getInt("max-input-buffer-size"),
config.getString("dispatcher"),
StreamSubscriptionTimeoutSettings(config),
config.getString("file-io-dispatcher"))
config.getString("file-io-dispatcher"),
config.getBoolean("debug-logging"))
/**
* Java API
@ -221,7 +222,8 @@ final case class MaterializerSettings(
maxInputBufferSize: Int,
dispatcher: String,
subscriptionTimeoutSettings: StreamSubscriptionTimeoutSettings,
fileIODispatcher: String) { // FIXME Why does this exist?!
fileIODispatcher: String, // FIXME Why does this exist?!
debugLogging: Boolean) {
require(initialInputBufferSize > 0, "initialInputBufferSize must be > 0")
@ -235,6 +237,9 @@ final case class MaterializerSettings(
def withDispatcher(dispatcher: String): MaterializerSettings =
copy(dispatcher = dispatcher)
def withDebugLogging(enable: Boolean): MaterializerSettings =
copy(debugLogging = enable)
private def isPowerOfTwo(n: Integer): Boolean = (n & (n - 1)) == 0 // FIXME this considers 0 a power of 2
}