/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _LOG4CXX_LOGGER_H
#define _LOG4CXX_LOGGER_H
#if defined(_MSC_VER)
#pragma warning ( push )
#pragma warning ( disable: 4231 4251 4275 4786 )
#endif
#include <log4cxx/helpers/appenderattachableimpl.h>
#include <log4cxx/level.h>
#include <log4cxx/helpers/pool.h>
#include <log4cxx/helpers/mutex.h>
#include <log4cxx/spi/location/locationinfo.h>
#include <log4cxx/helpers/resourcebundle.h>
#include <log4cxx/helpers/messagebuffer.h>
namespace log4cxx
{
namespace helpers {
class synchronized;
}
namespace spi {
class LoggerRepository;
LOG4CXX_PTR_DEF(LoggerRepository);
class LoggerFactory;
LOG4CXX_PTR_DEF(LoggerFactory);
}
class Logger;
/** smart pointer to a Logger class */
LOG4CXX_PTR_DEF(Logger);
LOG4CXX_LIST_DEF(LoggerList, LoggerPtr);
/**
This is the central class in the log4cxx package. Most logging
operations, except configuration, are done through this class.
*/
class LOG4CXX_EXPORT Logger :
public virtual log4cxx::spi::AppenderAttachable,
public virtual helpers::ObjectImpl
{
public:
DECLARE_ABSTRACT_LOG4CXX_OBJECT(Logger)
BEGIN_LOG4CXX_CAST_MAP()
LOG4CXX_CAST_ENTRY(Logger)
LOG4CXX_CAST_ENTRY(spi::AppenderAttachable)
END_LOG4CXX_CAST_MAP()
private:
/**
* Reference to memory pool.
*/
helpers::Pool* pool;
protected:
/**
The name of this logger.
*/
LogString name;
/**
The assigned level of this logger. The
<code>level</code> variable need not be assigned a value in
which case it is inherited form the hierarchy. */
LevelPtr level;
/**
The parent of this logger. All loggers have at least one
ancestor which is the root logger. */
LoggerPtr parent;
/** The resourceBundle for localized messages.
@see setResourceBundle, getResourceBundle
*/
helpers::ResourceBundlePtr resourceBundle;
// Loggers need to know what Hierarchy they are in
log4cxx::spi::LoggerRepository * repository;
helpers::AppenderAttachableImplPtr aai;
/** Additivity is set to true by default, that is children inherit
the appenders of their ancestors by default. If this variable is
set to <code>false</code> then the appenders found in the
ancestors of this logger are not used. However, the children
of this logger will inherit its appenders, unless the children
have their additivity flag set to <code>false</code> too. See
the user manual for more details. */
bool additive;
protected:
friend class DefaultLoggerFactory;
/**
This constructor created a new <code>logger</code> instance and
sets its name.
<p>It is intended to be used by sub-classes only. You should not
create categories directly.
@param pool lifetime of pool must be longer than logger.
@param name The name of the logger.
*/
Logger(log4cxx::helpers::Pool& pool, const LogString& name);
public:
~Logger();
void addRef() const;
void releaseRef() const;
/**
Add <code>newAppender</code> to the list of appenders of this
Logger instance.
<p>If <code>newAppender</code> is already in the list of
appenders, then it won't be added again.
*/
virtual void addAppender(const AppenderPtr& newAppender);
/**
Call the appenders in the hierrachy starting at
<code>this</code>. If no appenders could be found, emit a
warning.
<p>This method calls all the appenders inherited from the
hierarchy circumventing any evaluation of whether to log or not
to log the particular log request.
@param event the event to log.
@param p memory pool for any allocations needed to process request.
*/
void callAppenders(const log4cxx::spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) const;
/**
Close all attached appenders implementing the AppenderAttachable
interface.
*/
void closeNestedAppenders();
/**
Log a message string with the DEBUG level.
<p>This method first checks if this logger is <code>DEBUG</code>
enabled by comparing the level of this logger with the
DEBUG level. If this logger is
<code>DEBUG</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 debug(const std::string& msg, const log4cxx::spi::LocationInfo& location) const;
/**
Log a message string with the DEBUG level.
<p>This method first checks if this logger is <code>DEBUG</code>
enabled by comparing the level of this logger with the
DEBUG level. If this logger is
<code>DEBUG</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 debug(const std::string& msg) const;
#if LOG4CXX_WCHAR_T_API
/**
Log a message string with the DEBUG level.
<p>This method first checks if this logger is <code>DEBUG</code>
enabled by comparing the level of this logger with the
DEBUG level. If this logger is
<code>DEBUG</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 debug(const std::wstring& msg, const log4cxx::spi::LocationInfo& location) const;
/**
Log a message string with the DEBUG level.
<p>This method first checks if this logger is <code>DEBUG</code>
enabled by comparing the level of this logger with the
DEBUG level. If this logger is
<code>DEBUG</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 debug(const std::wstring& msg) const;
#endif
#if LOG4CXX_UNICHAR_API
/**
Log a message string with the DEBUG level.
<p>This method first checks if this logger is <code>DEBUG</code>
enabled by comparing the level of this logger with the
DEBUG level. If this logger is
<code>DEBUG</code> enabled, it proceeds t
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
已编译好的、vs2010下可用的log4cxx日志工具 (252个子文件)
all-wcprops 692B
all-wcprops 680B
all-wcprops 218B
Makefile.am 1KB
Makefile.am 1KB
Makefile.am 905B
Makefile.am 904B
Makefile.am 902B
Makefile.am 902B
Makefile.am 902B
Makefile.am 898B
Makefile.am 898B
Makefile.am 894B
Makefile.am 886B
Makefile.am 886B
Makefile.am 882B
Makefile.am 882B
log4cxx.dll 2.37MB
log4cxx.dll 1.44MB
entries 1KB
entries 1KB
entries 429B
format 2B
format 2B
format 2B
logger.h 73KB
messagebuffer.h 25KB
stream.h 20KB
ndc.h 15KB
patternlayout.h 14KB
domconfigurator.h 14KB
propertyconfigurator.h 13KB
exception.h 13KB
odbcappender.h 12KB
smtpappender.h 12KB
loggingevent.h 11KB
level.h 11KB
asyncappender.h 10KB
mdc.h 10KB
hierarchy.h 10KB
timebasedrollingpolicy.h 9KB
properties.h 9KB
sockethubappender.h 9KB
fileappender.h 9KB
transcoder.h 8KB
writerappender.h 8KB
cacheddateformat.h 8KB
thread.h 8KB
appenderskeleton.h 7KB
file.h 7KB
tchar.h 7KB
optionconverter.h 7KB
ttcclayout.h 7KB
logmanager.h 7KB
socketappenderskeleton.h 7KB
dailyrollingfileappender.h 6KB
syslogappender.h 6KB
xmlsocketappender.h 6KB
telnetappender.h 6KB
datagrampacket.h 6KB
levelrangefilter.h 6KB
socketappender.h 6KB
xmllayout.h 6KB
objectptr.h 5KB
patternparser.h 5KB
datagramsocket.h 5KB
filter.h 5KB
object.h 5KB
errorhandler.h 5KB
rollingfileappenderskeleton.h 5KB
fixedwindowrollingpolicy.h 5KB
xml.h 5KB
htmllayout.h 5KB
propertysetter.h 5KB
fallbackerrorhandler.h 5KB
nteventlogappender.h 5KB
charsetencoder.h 4KB
appender.h 4KB
loglog.h 4KB
rollingfileappender.h 4KB
loggerrepository.h 4KB
expressionfilter.h 4KB
levelmatchfilter.h 4KB
appenderattachableimpl.h 4KB
stringmatchfilter.h 4KB
rollingfileappender.h 4KB
charsetdecoder.h 4KB
rollingpolicybase.h 4KB
onlyonceerrorhandler.h 4KB
cyclicbuffer.h 4KB
inetaddress.h 4KB
datelayout.h 4KB
andfilter.h 4KB
locationinfo.h 4KB
resourcebundle.h 4KB
objectoutputstream.h 4KB
patternconverter.h 3KB
socket.h 3KB
rolloverdescription.h 3KB
fileinputstream.h 3KB
共 252 条
- 1
- 2
- 3
资源评论
- aerbeisishan20082016-05-28很好,可以看看
ysuchang
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- user+name.csv
- 安卓学习教材经验Android进阶学习资料安卓面试资料等文档资料合集(22个).zip
- 王小晨申论高分课.zip
- 基于matlab实现说话人语音识别源码+项目说明+PPT+报告(高分项目).zip
- VSc++编程助手1.0 - 1
- 基于matlab的说话人语音识别源码+PPT+报告(优质项目).zip
- 语音识别基于matlab说话人识别系统源码+报告PPT(高分优质项目).zip
- 毕业设计: 校园失物招领小程序的设计与实现论文(源码 + 数据库 + 说明文档)
- 美易ME-DUI自绘模块3.3-易语言模块
- 毕业设计:小程序消防知识每天学(源码 + 数据库 + 说明文档)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功