Add logging to Qubes() and QubesVM() objects

This commit is contained in:
Marek Marczykowski-Górecki 2017-04-15 20:10:04 +02:00
parent 7bafd631d4
commit e66b96edd1
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
3 changed files with 11 additions and 1 deletions

View File

@ -26,6 +26,8 @@ Main Qubes() class and related classes.
import socket
import subprocess
import logging
import qubesmgmt.base
import qubesmgmt.exc
import qubesmgmt.label
@ -114,6 +116,8 @@ class QubesBase(qubesmgmt.base.PropertyHolder):
pools = None
#: type of qubesd connection: either 'socket' or 'qrexec'
qubesd_connection_type = None
#: logger
log = None
def __init__(self):
super(QubesBase, self).__init__(self, 'mgmt.property.', 'dom0')
@ -124,6 +128,7 @@ class QubesBase(qubesmgmt.base.PropertyHolder):
self, 'mgmt.pool.List', qubesmgmt.storage.Pool)
#: cache for available storage pool drivers and options to create them
self._pool_drivers = None
self.log = logging.getLogger('app')
def _refresh_pool_drivers(self):
'''

View File

@ -29,7 +29,7 @@ import sys
import dbus
FORMAT_CONSOLE = '%(message)s'
FORMAT_CONSOLE = '%(name)s: %(message)s'
FORMAT_LOG = '%(asctime)s %(message)s'
FORMAT_DEBUG = '%(asctime)s ' \
'[%(processName)s %(module)s.%(funcName)s:%(lineno)d] %(name)s: %(message)s'

View File

@ -20,15 +20,20 @@
'''Qubes VM objects.'''
import logging
import qubesmgmt.base
import qubesmgmt.storage
class QubesVM(qubesmgmt.base.PropertyHolder):
'''Qubes domain.'''
log = None
def __init__(self, app, name):
super(QubesVM, self).__init__(app, 'mgmt.vm.property.', name)
self._volumes = None
self.log = logging.getLogger(name)
@property
def name(self):