import statvfs
import math
import gio
+import logging
def run_command(command, raise_on_try=True):
"""
Throws a RunTimeError if the command failed to execute or
if the command returns a non-zero exit status.
"""
+
+ debug("Trying to run command %s" % (command), True)
try:
p = subprocess.Popen(command,
stdout=subprocess.PIPE,
context using syslog.openlog()
"""
if verbose:
- syslog.syslog(syslog.LOG_NOTICE, message + '\n')
- sys.stderr.write(message + '\n')
+ logging.getLogger('time-slider').debug(message)
def log_error(loglevel, message):
"""
Requires caller to have first opened a syslog session
using syslog.openlog()
"""
- syslog.syslog(loglevel, message + '\n')
- sys.stderr.write(message + '\n')
+ logging.getLogger('time-slider').error(message)
def get_filesystem_capacity(path):
"""Returns filesystem space usage of path as an integer percentage of