Skip to content

Commit

Permalink
#9 add a bit of debug
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyweston committed Oct 10, 2017
1 parent b823aad commit 84eab19
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ object ErrorOnTemperatureSpike {
* is detected or pass through to the delegate if the system property `avoid.spikes` is not set.
*/
def apply(delegate: TemperatureWriter): TemperatureWriter = {
sys.props.get("avoid.spikes").map(_ => new ErrorOnTemperatureSpike(delegate)).getOrElse(delegate)
sys.props.get("avoid.spikes").map(_ => {
println(s"Temperature spikes greater than $spikePercentage% will not be recorded")
new ErrorOnTemperatureSpike(delegate)
}).getOrElse(delegate)
}
}

Expand Down

0 comments on commit 84eab19

Please sign in to comment.