   end
 
   def handle_info({:nerves_uart, _port, {:error, error}}, state) do
-    IO.warn "Received error message from :nerves_uart: '#{error}'"
+    if @debug do
+      IO.warn "Received error message from :nerves_uart: '#{error}'"
+    end
     {:noreply, state}
   end
 


  defp find_port do
    results = UART.enumerate
      |> Enum.find(fn({_k, v}) -> Map.get(v, :product_id) == @product_id end)

    case results do
      {path, _details} -> path

  alias TemperatureLogger.Writer

  @uart_pid UART
  @vendor_id 1105 # Texas Instruments
  @product_id 62514 # MSP430G2 Rev.1.4
  @baud 9600
  @on "O"
  @off "F"
  @debug false

  ## Client API

