<commit_before>/**
 * @file   LoggerManager.hpp
 * @brief  LoggerManager class prototype.
 * @author zer0
 * @date   2016-07-15
 */

#ifndef __INCLUDE_LIBTBAG__LIBTBAG_LOG_DETAILS_LOGGERMANAGER_HPP__
#define __INCLUDE_LIBTBAG__LIBTBAG_LOG_DETAILS_LOGGERMANAGER_HPP__

// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif

#include <libtbag/config.h>
#include <libtbag/pattern/Singleton.hpp>

// -------------------
NAMESPACE_LIBTBAG_OPEN
// -------------------

namespace log     {
namespace details {

/**
 * LoggerManager class prototype.
 *
 * @author zer0
 * @date   2016-07-15
 */
class LoggerManager : SINGLETON_INHERITANCE(LoggerManager)
{
public:
    SINGLETON_RESTRICT(LoggerManager);
};

} // namespace details
} // namespace log

// --------------------
NAMESPACE_LIBTBAG_CLOSE
// --------------------

#endif // __INCLUDE_LIBTBAG__LIBTBAG_LOG_DETAILS_LOGGERMANAGER_HPP__
<commit_msg>Create default interface of LoggerManager class.<commit_after>/**
 * @file   LoggerManager.hpp
 * @brief  LoggerManager class prototype.
 * @author zer0
 * @date   2016-07-15
 */

#ifndef __INCLUDE_LIBTBAG__LIBTBAG_LOG_DETAILS_LOGGERMANAGER_HPP__
#define __INCLUDE_LIBTBAG__LIBTBAG_LOG_DETAILS_LOGGERMANAGER_HPP__

// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif

#include <libtbag/config.h>
#include <libtbag/pattern/Singleton.hpp>
#include <libtbag/log/details/LoggerInterface.hpp>

#include <unordered_map>
#include <memory>
#include <string>

// -------------------
NAMESPACE_LIBTBAG_OPEN
// -------------------

namespace log     {
namespace details {

/**
 * LoggerManager class prototype.
 *
 * @author zer0
 * @date   2016-07-15
 */
class LoggerManager : SINGLETON_INHERITANCE(LoggerManager)
{
public:
    SINGLETON_RESTRICT(LoggerManager);

public:
    using LoggerPtr = std::unique_ptr<LoggerInterface>;
    using LoggerMap = std::unordered_map<std::string, LoggerPtr>;
    using LoggerPair = typename LoggerMap::value_type;

private:
    LoggerMap _logs;

public:
    void addLogger(std::string const & name, LoggerInterface * new_logger);
    void removeLogger(std::string const & name);
    std::size_t getSize() const noexcept;
    LoggerInterface * getLoggerPtr() noexcept;
};

} // namespace details
} // namespace log

// --------------------
NAMESPACE_LIBTBAG_CLOSE
// --------------------

#endif // __INCLUDE_LIBTBAG__LIBTBAG_LOG_DETAILS_LOGGERMANAGER_HPP__

{'fraction_non_alphanumeric': 0.15985576923076922, 'fraction_numerical': 0.017628205128205128, 'mean_word_length': 3.4669051878354202, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2122228', 'n_tokens_mistral': 890, 'n_tokens_neox': 824, 'n_words': 158}