Add logging to Qubes() and QubesVM() objects
This commit is contained in:
parent
7bafd631d4
commit
e66b96edd1
@ -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):
|
||||
'''
|
||||
|
@ -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'
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user