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 socket
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
import logging
|
||||||
|
|
||||||
import qubesmgmt.base
|
import qubesmgmt.base
|
||||||
import qubesmgmt.exc
|
import qubesmgmt.exc
|
||||||
import qubesmgmt.label
|
import qubesmgmt.label
|
||||||
@ -114,6 +116,8 @@ class QubesBase(qubesmgmt.base.PropertyHolder):
|
|||||||
pools = None
|
pools = None
|
||||||
#: type of qubesd connection: either 'socket' or 'qrexec'
|
#: type of qubesd connection: either 'socket' or 'qrexec'
|
||||||
qubesd_connection_type = None
|
qubesd_connection_type = None
|
||||||
|
#: logger
|
||||||
|
log = None
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(QubesBase, self).__init__(self, 'mgmt.property.', 'dom0')
|
super(QubesBase, self).__init__(self, 'mgmt.property.', 'dom0')
|
||||||
@ -124,6 +128,7 @@ class QubesBase(qubesmgmt.base.PropertyHolder):
|
|||||||
self, 'mgmt.pool.List', qubesmgmt.storage.Pool)
|
self, 'mgmt.pool.List', qubesmgmt.storage.Pool)
|
||||||
#: cache for available storage pool drivers and options to create them
|
#: cache for available storage pool drivers and options to create them
|
||||||
self._pool_drivers = None
|
self._pool_drivers = None
|
||||||
|
self.log = logging.getLogger('app')
|
||||||
|
|
||||||
def _refresh_pool_drivers(self):
|
def _refresh_pool_drivers(self):
|
||||||
'''
|
'''
|
||||||
|
@ -29,7 +29,7 @@ import sys
|
|||||||
|
|
||||||
import dbus
|
import dbus
|
||||||
|
|
||||||
FORMAT_CONSOLE = '%(message)s'
|
FORMAT_CONSOLE = '%(name)s: %(message)s'
|
||||||
FORMAT_LOG = '%(asctime)s %(message)s'
|
FORMAT_LOG = '%(asctime)s %(message)s'
|
||||||
FORMAT_DEBUG = '%(asctime)s ' \
|
FORMAT_DEBUG = '%(asctime)s ' \
|
||||||
'[%(processName)s %(module)s.%(funcName)s:%(lineno)d] %(name)s: %(message)s'
|
'[%(processName)s %(module)s.%(funcName)s:%(lineno)d] %(name)s: %(message)s'
|
||||||
|
@ -20,15 +20,20 @@
|
|||||||
|
|
||||||
'''Qubes VM objects.'''
|
'''Qubes VM objects.'''
|
||||||
|
|
||||||
|
import logging
|
||||||
import qubesmgmt.base
|
import qubesmgmt.base
|
||||||
import qubesmgmt.storage
|
import qubesmgmt.storage
|
||||||
|
|
||||||
|
|
||||||
class QubesVM(qubesmgmt.base.PropertyHolder):
|
class QubesVM(qubesmgmt.base.PropertyHolder):
|
||||||
'''Qubes domain.'''
|
'''Qubes domain.'''
|
||||||
|
|
||||||
|
log = None
|
||||||
|
|
||||||
def __init__(self, app, name):
|
def __init__(self, app, name):
|
||||||
super(QubesVM, self).__init__(app, 'mgmt.vm.property.', name)
|
super(QubesVM, self).__init__(app, 'mgmt.vm.property.', name)
|
||||||
self._volumes = None
|
self._volumes = None
|
||||||
|
self.log = logging.getLogger(name)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user