hierarchylocker.h
Go to the documentation of this file.
// -*- C++ -*-
// Module: Log4CPLUS
// File: hierarchylocker.h
// Created: 8/2003
// Author: Tad E. Smith
//
//
// Copyright 2003-2017 Tad E. Smith
//
// Licensed 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 LOG4CPLUS_HIERARCHY_LOCKER_HEADER_
#define LOG4CPLUS_HIERARCHY_LOCKER_HEADER_
#include <log4cplus/config.hxx>
#if defined (LOG4CPLUS_HAVE_PRAGMA_ONCE)
#pragma once
#endif
#include <log4cplus/tstring.h>
#include <log4cplus/appender.h>
#include <log4cplus/logger.h>
namespace log4cplus
{
class Hierarchy;
class LOG4CPLUS_EXPORT HierarchyLocker {
public:
// ctor & dtor
HierarchyLocker(Hierarchy& h);
~HierarchyLocker() LOG4CPLUS_NOEXCEPT_FALSE;
void resetConfiguration();
Logger getInstance(const log4cplus::tstring& name);
Logger getInstance(const log4cplus::tstring& name, spi::LoggerFactory& factory);
void addAppender(Logger &logger, log4cplus::SharedAppenderPtr& appender);
private:
// Data
Hierarchy& h;
log4cplus::thread::MutexGuard hierarchyLocker;
LoggerList loggerList;
};
} // end namespace log4cplus
#endif // LOG4CPLUS_HIERARCHY_LOCKER_HEADER_
appender.h
log4cplus::HierarchyLocker::resetConfiguration
void resetConfiguration()
Calls the resetConfiguration() method on the locked Hierarchy.
log4cplus::HierarchyLocker::getInstance
Logger getInstance(const log4cplus::tstring &name)
Calls the getInstance() method on the locked Hierarchy.
log4cplus::HierarchyLocker::HierarchyLocker
HierarchyLocker(Hierarchy &h)
log4cplus::HierarchyLocker::addAppender
void addAppender(Logger &logger, log4cplus::SharedAppenderPtr &appender)
log4cplus::HierarchyLocker::~HierarchyLocker
~HierarchyLocker() LOG4CPLUS_NOEXCEPT_FALSE
log4cplus::Hierarchy
This class is specialized in retrieving loggers by name and also maintaining the logger hierarchy.
Definition hierarchy.h:64
log4cplus::Logger
This is the central class in the log4cplus package.
Definition logger.h:71
config.hxx
LOG4CPLUS_NOEXCEPT_FALSE
#define LOG4CPLUS_NOEXCEPT_FALSE
Definition config.hxx:102
logger.h
This header defines the Logger class and the logging macros.
log4cplus::spi
Definition layout.h:62
log4cplus::thread
Definition queue.h:42
log4cplus
Definition appender.h:46
log4cplus::SharedAppenderPtr
helpers::SharedObjectPtr< Appender > SharedAppenderPtr
This is a pointer to an Appender.
Definition appender.h:336
log4cplus::tstring
std::basic_string< tchar > tstring
Definition tstring.h:39
log4cplus::LoggerList
std::vector< Logger > LoggerList
This is a list of Loggers.
Definition logger.h:61
tstring.h
LOG4CPLUS_EXPORT
#define LOG4CPLUS_EXPORT
Definition win32.h:141