⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 logger.h

📁 log4cxx 0.10 unix下编译包
💻 H
📖 第 1 页 / 共 5 页
字号:
        void getName(std::basic_string<UniChar>& name) const;#endif#if LOG4CXX_CFSTRING_API        /**        * Get logger name.        * @param name buffer to which name is appended.          */        void getName(CFStringRef& name) const;#endif        /**        Returns the parent of this logger. Note that the parent of a        given logger may change during the lifetime of the logger.        <p>The root logger will return <code>0</code>.        */        LoggerPtr getParent() const;        /**        Returns the assigned Level, if any, for this Logger.        @return Level - the assigned Level, can be null.        */        LevelPtr getLevel() const;        /**        * Retrieve a logger by name in current encoding.        * @param name logger name.         */        static LoggerPtr getLogger(const std::string& name);        /**        * Retrieve a logger by name in current encoding.        * @param name logger name.         */        static LoggerPtr getLogger(const char* const name);#if LOG4CXX_WCHAR_T_API        /**        * Retrieve a logger by name.        * @param name logger name.         */        static LoggerPtr getLogger(const std::wstring& name);        /**        * Retrieve a logger by name.        * @param name logger name.         */        static LoggerPtr getLogger(const wchar_t* const name);#endif#if LOG4CXX_UNICHAR_API        /**        * Retrieve a logger by name.        * @param name logger name.         */        static LoggerPtr getLogger(const std::basic_string<UniChar>& name);#endif#if LOG4CXX_CFSTRING_API        /**        * Retrieve a logger by name.        * @param name logger name.         */        static LoggerPtr getLogger(const CFStringRef& name);#endif        /**        * Retrieve a logger by name in Unicode.        * @param name logger name.         */        static LoggerPtr getLoggerLS(const LogString& name);        /**        Retrieve the root logger.        */        static LoggerPtr getRootLogger();        /**        Like #getLogger except that the type of logger        instantiated depends on the type returned by the        LoggerFactory#makeNewLoggerInstance method of the        <code>factory</code> parameter.        <p>This method is intended to be used by sub-classes.        @param name The name of the logger to retrieve.        @param factory A LoggerFactory implementation that will        actually create a new Instance.        */        static LoggerPtr getLoggerLS(const LogString& name,                        const log4cxx::spi::LoggerFactoryPtr& factory);        /**        Like #getLogger except that the type of logger        instantiated depends on the type returned by the        LoggerFactory#makeNewLoggerInstance method of the        <code>factory</code> parameter.        <p>This method is intended to be used by sub-classes.        @param name The name of the logger to retrieve.        @param factory A LoggerFactory implementation that will        actually create a new Instance.        */        static LoggerPtr getLogger(const std::string& name,                        const log4cxx::spi::LoggerFactoryPtr& factory);#if LOG4CXX_WCHAR_T_API        /**        Like #getLogger except that the type of logger        instantiated depends on the type returned by the        LoggerFactory#makeNewLoggerInstance method of the        <code>factory</code> parameter.        <p>This method is intended to be used by sub-classes.        @param name The name of the logger to retrieve.        @param factory A LoggerFactory implementation that will        actually create a new Instance.        */        static LoggerPtr getLogger(const std::wstring& name,                        const log4cxx::spi::LoggerFactoryPtr& factory);#endif#if LOG4CXX_UNICHAR_API        /**        Like #getLogger except that the type of logger        instantiated depends on the type returned by the        LoggerFactory#makeNewLoggerInstance method of the        <code>factory</code> parameter.        <p>This method is intended to be used by sub-classes.        @param name The name of the logger to retrieve.        @param factory A LoggerFactory implementation that will        actually create a new Instance.        */        static LoggerPtr getLogger(const std::basic_string<UniChar>& name,                        const log4cxx::spi::LoggerFactoryPtr& factory);#endif#if LOG4CXX_CFSTRING_API        /**        Like #getLogger except that the type of logger        instantiated depends on the type returned by the        LoggerFactory#makeNewLoggerInstance method of the        <code>factory</code> parameter.        <p>This method is intended to be used by sub-classes.        @param name The name of the logger to retrieve.        @param factory A LoggerFactory implementation that will        actually create a new Instance.        */        static LoggerPtr getLogger(const CFStringRef& name,                        const log4cxx::spi::LoggerFactoryPtr& factory);#endif        /**        Return the <em>inherited</em> ResourceBundle for this logger.        This method walks the hierarchy to find the appropriate resource bundle.        It will return the resource bundle attached to the closest ancestor of        this logger, much like the way priorities are searched. In case there        is no bundle in the hierarchy then <code>NULL</code> is returned.        */        helpers::ResourceBundlePtr getResourceBundle() const;        protected:        /**        Returns the string resource coresponding to <code>key</code> in this        logger's inherited resource bundle.        If the resource cannot be found, then an {@link #error error} message        will be logged complaining about the missing resource.        @see #getResourceBundle.        */        LogString getResourceBundleString(const LogString& key) const;        public:        /**        Log a message string with the INFO level.        <p>This method first checks if this logger is <code>INFO</code>        enabled by comparing the level of this logger with the         INFO level. If this logger is        <code>INFO</code> enabled, it proceeds to call all the        registered appenders in this logger and also higher in the        hierarchy depending on the value of the additivity flag.        @param msg the message string to log.        @param location location of source of logging request.                */       void info(const std::string& msg, const log4cxx::spi::LocationInfo& location) const;       void info(const std::string& msg) const;#if LOG4CXX_WCHAR_T_API        /**        Log a message string with the INFO level.        <p>This method first checks if this logger is <code>INFO</code>        enabled by comparing the level of this logger with the         INFO level. If this logger is        <code>INFO</code> enabled, it proceeds to call all the        registered appenders in this logger and also higher in the        hierarchy depending on the value of the additivity flag.        @param msg the message string to log.        @param location location of source of logging request.                */       void info(const std::wstring& msg, const log4cxx::spi::LocationInfo& location) const;        /**        Log a message string with the INFO level.        <p>This method first checks if this logger is <code>INFO</code>        enabled by comparing the level of this logger with the         INFO level. If this logger is        <code>INFO</code> enabled, it proceeds to call all the        registered appenders in this logger and also higher in the        hierarchy depending on the value of the additivity flag.        @param msg the message string to log.                */       void info(const std::wstring& msg) const;#endif#if LOG4CXX_UNICHAR_API        /**        Log a message string with the INFO level.        <p>This method first checks if this logger is <code>INFO</code>        enabled by comparing the level of this logger with the         INFO level. If this logger is        <code>INFO</code> enabled, it proceeds to call all the        registered appenders in this logger and also higher in the        hierarchy depending on the value of the additivity flag.        @param msg the message string to log.        @param location location of source of logging request.                */        void info(const std::basic_string<UniChar>& msg, const log4cxx::spi::LocationInfo& location) const;        /**        Log a message string with the INFO level.        <p>This method first checks if this logger is <code>INFO</code>        enabled by comparing the level of this logger with the         INFO level. If this logger is        <code>INFO</code> enabled, it proceeds to call all the        registered appenders in this logger and also higher in the        hierarchy depending on the value of the additivity flag.        @param msg the message string to log.                */        void info(const std::basic_string<UniChar>& msg) const;#endif#if LOG4CXX_CFSTRING_API        /**        Log a message string with the INFO level.        <p>This method first checks if this logger is <code>INFO</code>        enabled by comparing the level of this logger with the         INFO level. If this logger is        <code>INFO</code> enabled, it proceeds to call all the        registered appenders in this logger and also higher in the        hierarchy depending on the value of the additivity flag.        @param msg the message string to log.        @param location location of source of logging request.                */        void info(const CFStringRef& msg, const log4cxx::spi::LocationInfo& location) const;        /**        Log a message string with the INFO level.        <p>This method first checks if this logger is <code>INFO</code>        enabled by comparing the level of this logger with the         INFO level. If this logger is        <code>INFO</code> enabled, it proceeds to call all the        registered appenders in this logger and also higher in the        hierarchy depending on the value of the additivity flag.        @param msg the message string to log.                */        void info(const CFStringRef& msg) const;#endif        /**        Is the appender passed as parameter attached to this logger?        */        bool isAttached(const AppenderPtr& appender) const;       /**        *  Check whether this logger is enabled for the <code>DEBUG</code>        *  Level.        *        *  <p> This function is intended to lessen the computational cost of        *  disabled log debug statements.        *        *  <p> For some <code>logger</code> Logger object, when you write,        *  <pre>        *      logger->debug("debug message");        *  </pre>        *        *  <p>You incur the cost constructing the message, concatenation in        *  this case, regardless of whether the message is logged or not.        *        *  <p>If you are worried about speed, then you should write        *  <pre>        *    if(logger->isDebugEnabled()) {        *      logger->debug("debug message");        *    }        *  </pre>        *        *  <p>This way you will not incur the cost of parameter        *  construction if debugging is disabled for <code>logger</code>. On        *  the other hand, if the <code>logger</code> is debug enabled, you        *  will incur the cost of evaluating whether the logger is debug        *  enabled twice. Once in <code>isDebugEnabled</code> and once in        *  the <code>debug</code>.  This is an insignificant overhead        *  since evaluating a logger takes about 1%% of the time it        *  takes to actually log.        *        *  @return bool - <code>true</code> if this logger is debug        *  enabled, <code>false</code> otherwise.        *   */        bool isDebugEnabled() const;        /**        Check whether this logger is enabled for a given        Level passed as parameter.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -