netinvent / command_runner

Substitute for subprocess that handles all hassle that comes from different platform and python versions, and allows live stdout and stderr capture for background job/interactive GUI programming ;)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Disabled all console outputs but still do

AliAtes opened this issue · comments

err_code, stdout, stderr = command_runner(params, timeout=1, encoding='utf-8', method='monitor', live_output=False, stdout=False, stderr=False, split_streams=True)

When timeout prints error to console:
"Timeout 1 seconds expired for command "..." execution. Original output was: None"

How to suspress outputs completely?

The output you're seeing are the logs from command_runner module.
You can silence the module with the following:

from command_runner import command_runner
import logging

logging.getLogger("command_runner").setLevel(logging.CRITICAL)

err_code, stdout, stderr = command_runner(params, timeout=1, encoding='utf-8', method='monitor', live_output=False, stdout=False, stderr=False, split_streams=True)

Version 1.5.0 will have silent=True parameter which is easier, and doesn't suppress debug messages.