public static function log($channel, $message) { if (!self::isChannelAllowed($channel) || !self::$s_logger) { return; } $line = date("c"); $line .= " [" . LoggingConstants::getLogChannelName($channel) . "] "; $line .= self::getSource(); $line .= $message . "\r\n"; $source = debug_backtrace(); self::$s_logger->log($line); }
public static function getChannelByName($name) { if (self::$s_channels == null) { self::$s_channels = array(); self::$s_channels["WEBORB INFO"] = 0x2; self::$s_channels["WEBORB DEBUG"] = 0x4; self::$s_channels["WEBORB ERROR"] = 0x8; self::$s_channels["WEBORB SERIALIZATION"] = 0x10; self::$s_channels["WEBORB EXCEPTION"] = 0x20; self::$s_channels["WEBORB INSTRUMENTATION"] = 0x40; self::$s_channels["WEBORB SECURITY"] = 0x80; self::$s_channels["WEBORB PERFORMANCE"] = 0x100; self::$s_channels["WEBORB MYDEBUG"] = 0x200; self::$s_channels["REF COUNT"] = 0x400; } return self::$s_channels[$name]; }
public function EnableCategory($category, $enabled) { $configNode = $this->m_configNode->getElementsByTagName(ORBConstants::LOG); foreach ($configNode as $node) { if ($node->nodeValue == $category) { $node->setAttribute(ORBConstants::ENABLE, $enabled ? ORBConstants::YES : ORBConstants::NO); $this->saveConfig(); if ($enabled) { Log::startLogging(LoggingConstants::getChannelByName($category)); } else { Log::stopLogging(LoggingConstants::getChannelByName($category)); } return; } } }