Suppress os_mon logging messages

After I’ve added the :os_mon application for the LiveViewDashboard I’m now seeing two logger messages each time I run the test suite.

[os_mon] cpu supervisor port (cpu_sup): Erlang has closed
[os_mon] memory supervisor port (memsup): Erlang has closed

I also see two new logging messages each time I start the Phoneix server.

[info]     :alarm_handler: {:set, {{:disk_almost_full, '/System/Volumes/Data'}, []}}
[info]     :alarm_handler: {:set, {:system_memory_high_watermark, []}}

Is there any way to suppress these messages?

2 Likes
  1. Simplest solution? Do not start os_mon in test environment.
  2. Change default alert_handler to not log messages.
  1. config/test.exs
config :os_mon,
  start_cpu_sup: false,
  start_disksup: false,
  start_memsup: false
10 Likes

Thanks for the ideas @hauleth and @webuhu. I like the simplicity of simply not starting the monitors that raise the alarms in the test environment since non of my code relies on those.