Commit ec54cb2f authored by Marco Mariani's avatar Marco Mariani

provide a logger name for all commands

parent e2ca58dc
...@@ -11,7 +11,7 @@ class BangCommand(ConfigCommand): ...@@ -11,7 +11,7 @@ class BangCommand(ConfigCommand):
request update on all partitions request update on all partitions
""" """
log = logging.getLogger(__name__) log = logging.getLogger('bang')
def get_parser(self, prog_name): def get_parser(self, prog_name):
ap = super(BangCommand, self).get_parser(prog_name) ap = super(BangCommand, self).get_parser(prog_name)
......
...@@ -17,7 +17,7 @@ class CacheLookupCommand(ConfigCommand): ...@@ -17,7 +17,7 @@ class CacheLookupCommand(ConfigCommand):
with the OS you are currently running. with the OS you are currently running.
""" """
log = logging.getLogger(__name__) log = logging.getLogger('cache-lookup')
def get_parser(self, prog_name): def get_parser(self, prog_name):
ap = super(CacheLookupCommand, self).get_parser(prog_name) ap = super(CacheLookupCommand, self).get_parser(prog_name)
......
...@@ -22,7 +22,7 @@ class ConsoleCommand(ClientConfigCommand): ...@@ -22,7 +22,7 @@ class ConsoleCommand(ClientConfigCommand):
>>> request(kvm, "myuniquekvm").getConnectionParameter("url") >>> request(kvm, "myuniquekvm").getConnectionParameter("url")
""" """
log = logging.getLogger(__name__) log = logging.getLogger('console')
def get_parser(self, prog_name): def get_parser(self, prog_name):
ap = super(ConsoleCommand, self).get_parser(prog_name) ap = super(ConsoleCommand, self).get_parser(prog_name)
......
...@@ -49,7 +49,10 @@ class SlapOSApp(cliff.app.App): ...@@ -49,7 +49,10 @@ class SlapOSApp(cliff.app.App):
# etc. # etc.
# #
log = logging.getLogger(__name__) log = logging.getLogger('slapos')
CONSOLE_MESSAGE_FORMAT = '%(message)s'
LOG_FILE_MESSAGE_FORMAT = '[%(asctime)s] %(levelname)-8s %(name)s %(message)s'
def __init__(self): def __init__(self):
super(SlapOSApp, self).__init__( super(SlapOSApp, self).__init__(
......
...@@ -12,7 +12,7 @@ class RegisterCommand(Command): ...@@ -12,7 +12,7 @@ class RegisterCommand(Command):
register a node in the SlapOS cloud register a node in the SlapOS cloud
""" """
log = logging.getLogger('Register') log = logging.getLogger('register')
def get_parser(self, prog_name): def get_parser(self, prog_name):
ap = super(RegisterCommand, self).get_parser(prog_name) ap = super(RegisterCommand, self).get_parser(prog_name)
......
...@@ -11,7 +11,7 @@ class RemoveCommand(ClientConfigCommand): ...@@ -11,7 +11,7 @@ class RemoveCommand(ClientConfigCommand):
remove a Software from a node remove a Software from a node
""" """
log = logging.getLogger(__name__) log = logging.getLogger('remove')
def get_parser(self, prog_name): def get_parser(self, prog_name):
ap = super(RemoveCommand, self).get_parser(prog_name) ap = super(RemoveCommand, self).get_parser(prog_name)
......
...@@ -25,7 +25,7 @@ class RequestCommand(ClientConfigCommand): ...@@ -25,7 +25,7 @@ class RequestCommand(ClientConfigCommand):
request an Instance request an Instance
""" """
log = logging.getLogger(__name__) log = logging.getLogger('request')
def get_parser(self, prog_name): def get_parser(self, prog_name):
ap = super(RequestCommand, self).get_parser(prog_name) ap = super(RequestCommand, self).get_parser(prog_name)
......
...@@ -11,14 +11,11 @@ from slapos.grid.slapgrid import (merged_options, check_missing_parameters, chec ...@@ -11,14 +11,11 @@ from slapos.grid.slapgrid import (merged_options, check_missing_parameters, chec
class SlapgridCommand(ConfigCommand): class SlapgridCommand(ConfigCommand):
log = logging.getLogger(__name__) log = None
method_name = NotImplemented method_name = NotImplemented
default_pidfile = NotImplemented default_pidfile = NotImplemented
CONSOLE_MESSAGE_FORMAT = '%(message)s'
LOG_FILE_MESSAGE_FORMAT = '[%(asctime)s] %(levelname)-8s %(name)s %(message)s'
def get_parser(self, prog_name): def get_parser(self, prog_name):
ap = super(SlapgridCommand, self).get_parser(prog_name) ap = super(SlapgridCommand, self).get_parser(prog_name)
...@@ -88,6 +85,8 @@ class SlapgridCommand(ConfigCommand): ...@@ -88,6 +85,8 @@ class SlapgridCommand(ConfigCommand):
class SoftwareCommand(SlapgridCommand): class SoftwareCommand(SlapgridCommand):
"""hook for entry point to process Software Releases""" """hook for entry point to process Software Releases"""
log = logging.getLogger('software')
method_name = 'processSoftwareReleaseList' method_name = 'processSoftwareReleaseList'
default_pidfile = '/opt/slapos/slapgrid-sr.pid' default_pidfile = '/opt/slapos/slapgrid-sr.pid'
...@@ -103,6 +102,8 @@ class SoftwareCommand(SlapgridCommand): ...@@ -103,6 +102,8 @@ class SoftwareCommand(SlapgridCommand):
class InstanceCommand(SlapgridCommand): class InstanceCommand(SlapgridCommand):
"""hook for entry point to process Computer Partitions""" """hook for entry point to process Computer Partitions"""
log = logging.getLogger('instance')
method_name = 'processComputerPartitionList' method_name = 'processComputerPartitionList'
default_pidfile = '/opt/slapos/slapgrid-cp.pid' default_pidfile = '/opt/slapos/slapgrid-cp.pid'
...@@ -118,5 +119,7 @@ class InstanceCommand(SlapgridCommand): ...@@ -118,5 +119,7 @@ class InstanceCommand(SlapgridCommand):
class ReportCommand(SlapgridCommand): class ReportCommand(SlapgridCommand):
"""hook for entry point to process Usage Reports""" """hook for entry point to process Usage Reports"""
log = logging.getLogger('report')
method_name = 'agregateAndSendUsage' method_name = 'agregateAndSendUsage'
default_pidfile = '/opt/slapos/slapgrid-ur.pid' default_pidfile = '/opt/slapos/slapgrid-ur.pid'
...@@ -15,7 +15,7 @@ class SupervisorctlCommand(ConfigCommand): ...@@ -15,7 +15,7 @@ class SupervisorctlCommand(ConfigCommand):
manage supervisor processes manage supervisor processes
""" """
log = logging.getLogger(__name__) log = logging.getLogger('supervisorctl')
def get_parser(self, prog_name): def get_parser(self, prog_name):
ap = super(SupervisorctlCommand, self).get_parser(prog_name) ap = super(SupervisorctlCommand, self).get_parser(prog_name)
......
...@@ -10,7 +10,7 @@ from slapos.grid.svcbackend import launchSupervisord ...@@ -10,7 +10,7 @@ from slapos.grid.svcbackend import launchSupervisord
class SupervisordCommand(ConfigCommand): class SupervisordCommand(ConfigCommand):
"""run the supervisor daemon""" """run the supervisor daemon"""
log = logging.getLogger(__name__) log = logging.getLogger('supervisord')
def take_action(self, args): def take_action(self, args):
configp = self.fetch_config(args) configp = self.fetch_config(args)
......
...@@ -11,7 +11,7 @@ class SupplyCommand(ClientConfigCommand): ...@@ -11,7 +11,7 @@ class SupplyCommand(ClientConfigCommand):
supply a Software to a node supply a Software to a node
""" """
log = logging.getLogger(__name__) log = logging.getLogger('supply')
def get_parser(self, prog_name): def get_parser(self, prog_name):
ap = super(SupplyCommand, self).get_parser(prog_name) ap = super(SupplyCommand, self).get_parser(prog_name)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment