Module: Dcmgr::Logger
- Included in:
- Drivers::Comstar, Drivers::IIJGIOStorage, Drivers::Kvm, Drivers::LinuxIscsi, Drivers::LocalStorage, Drivers::Lxc, Drivers::Raw, Drivers::S3Storage, Drivers::SunIscsi, Drivers::Zfs, Endpoints::CoreAPI, Endpoints::Ec2Metadata, Endpoints::Metadata, MessagingClient, NodeModules::Bandwidth, NodeModules::CustomEventHandler, NodeModules::HvaCollector, NodeModules::InstanceHA, NodeModules::InstanceMonitor, NodeModules::Nat, NodeModules::OpenFlowController, NodeModules::OvsOfctl, NodeModules::Scheduler, NodeModules::ServiceNetfilter, NodeModules::ServiceOpenFlow, NodeModules::StaCollector, NodeModules::StaTgtInitializer, Rpc::HvaHandler, Rpc::StaHandler, Scheduler::HostNode::ExcludeSame, Scheduler::HostNode::LeastUsage, Scheduler::HostNode::SpecifyNode, Scheduler::Network::PerInstance, Scheduler::StorageNode::LeastUsage, VNet::Netfilter::NetfilterCache, VNet::Netfilter::NetfilterController
- Defined in:
- lib/dcmgr/logger.rb
Class Method Summary collapse
-
.create(name = nil) ⇒ Object
Factory method for ::Logger.
- .default_logdev ⇒ Object
- .included(klass) ⇒ Object
Class Method Details
.create(name = nil) ⇒ Object
Factory method for ::Logger
18 19 20 21 22 |
# File 'lib/dcmgr/logger.rb', line 18 def self.create(name=nil) l = ::Logger.new(default_logdev) l.progname = name l end |
.default_logdev ⇒ Object
13 14 15 |
# File 'lib/dcmgr/logger.rb', line 13 def self.default_logdev @logdev end |
.included(klass) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/dcmgr/logger.rb', line 24 def self.included(klass) klass.class_eval { @class_logger = Logger.create(self.to_s.split('::').last) def self.logger @class_logger end def logger self.class.logger end def self.logger_name @class_logger.progname end def self.logger_name=(name) @class_logger.progname = name end } end |