当前位置: 首页>>代码示例>>C++>>正文


C++ TraceLogger函数代码示例

本文整理汇总了C++中TraceLogger函数的典型用法代码示例。如果您正苦于以下问题:C++ TraceLogger函数的具体用法?C++ TraceLogger怎么用?C++ TraceLogger使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了TraceLogger函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Base

////////////////////////////////////////////////////////////
// MPLobby
////////////////////////////////////////////////////////////
MPLobby::MPLobby(my_context ctx) :
    Base(ctx)
{
    TraceLogger(FSM) << "(HumanClientFSM) MPLobby";

    Client().Register(Client().GetClientUI().GetMultiPlayerLobbyWnd());
}
开发者ID:MatGB,项目名称:freeorion,代码行数:10,代码来源:HumanClientFSM.cpp

示例2: ListDir

/**  \brief Return a vector of absolute paths to files in the given path
 * 
 * @param[in] path relative or absolute directory (searched recursively)
 * @return Any regular files in
 * @return  if absolute directory: path
 * @return  if relative directory: GetResourceDir() / path
*/
std::vector<fs::path> ListDir(const fs::path& path) {
    std::vector<fs::path> retval;
    bool is_rel = path.is_relative();
    if (!is_rel && (fs::is_empty(path) || !fs::is_directory(path))) {
        DebugLogger() << "ListDir: File " << PathToString(path) << " was not included as it is empty or not a directoy";
    } else {
        const fs::path& default_path = is_rel ? GetResourceDir() / path : path;

        for (fs::recursive_directory_iterator dir_it(default_path);
             dir_it != fs::recursive_directory_iterator(); ++dir_it)
        {
            if (fs::is_regular_file(dir_it->status())) {
                retval.push_back(dir_it->path());
            } else if (!fs::is_directory(dir_it->status())) {
                TraceLogger() << "Parse: Unknown file not included: " << PathToString(dir_it->path());
            }
        }
    }

    if (retval.empty()) {
        DebugLogger() << "ListDir: No files found for " << path.string();
    }

    return retval;
}
开发者ID:cpeosphoros,项目名称:freeorion,代码行数:32,代码来源:Directories.cpp

示例3: TraceLogger

boost::statechart::result MPLobby::react(const LobbyUpdate& msg) {
    TraceLogger(FSM) << "(HumanClientFSM) MPLobby.LobbyUpdate";
    MultiplayerLobbyData lobby_data;
    ExtractLobbyUpdateMessageData(msg.m_message, lobby_data);
    Client().GetClientUI().GetMultiPlayerLobbyWnd()->LobbyUpdate(lobby_data);
    return discard_event();
}
开发者ID:matt474,项目名称:freeorion,代码行数:7,代码来源:HumanClientFSM.cpp

示例4: TraceLogger

void Species::Init() {
    for (auto& effect : m_effects) {
        effect->SetTopLevelContent(m_name);
    }

    if (!m_location) {
        // set up a Condition structure to match popcenters that have
        // (not uninhabitable) environment for this species
        std::vector<std::unique_ptr<ValueRef::ValueRefBase< ::PlanetEnvironment>>> environments_vec;
        environments_vec.push_back(
            boost::make_unique<ValueRef::Constant<PlanetEnvironment>>( ::PE_UNINHABITABLE));
        auto this_species_name_ref =
            boost::make_unique<ValueRef::Constant<std::string>>(m_name);  // m_name specifies this species
        auto enviro_cond = std::unique_ptr<Condition::ConditionBase>(
            boost::make_unique<Condition::Not>(
                std::unique_ptr<Condition::ConditionBase>(
                    boost::make_unique<Condition::PlanetEnvironment>(
                        std::move(environments_vec), std::move(this_species_name_ref)))));

        auto type_cond = std::unique_ptr<Condition::ConditionBase>(boost::make_unique<Condition::Type>(
            boost::make_unique<ValueRef::Constant<UniverseObjectType>>( ::OBJ_POP_CENTER)));

        std::vector<std::unique_ptr<Condition::ConditionBase>> operands;
        operands.push_back(std::move(enviro_cond));
        operands.push_back(std::move(type_cond));

        m_location = std::unique_ptr<Condition::ConditionBase>(boost::make_unique<Condition::And>(std::move(operands)));
    }
    m_location->SetTopLevelContent(m_name);

    if (m_combat_targets)
        m_combat_targets->SetTopLevelContent(m_name);

    TraceLogger() << "Species::Init: " << Dump();
}
开发者ID:adrianbroher,项目名称:freeorion,代码行数:35,代码来源:Species.cpp

示例5: GetLocale

std::locale GetLocale(const std::string& name) {
    static bool locale_init { false };
    // Initialize backend and generator on first use, provide a log for current enivornment locale
    static auto locale_backend = boost::locale::localization_backend_manager::global();
    if (!locale_init)
        locale_backend.select("std");
    static boost::locale::generator locale_gen(locale_backend);
    if (!locale_init) {
        locale_gen.locale_cache_enabled(true);
        try {
            InfoLogger() << "Global locale: " << std::use_facet<boost::locale::info>(locale_gen("")).name();
        } catch (const std::runtime_error&) {
            ErrorLogger() << "Global locale: set to invalid locale, setting to C locale";
            std::locale::global(std::locale::classic());
        }
        locale_init = true;
    }

    std::locale retval;
    try {
        retval = locale_gen(name);
    } catch(const std::runtime_error&) {
        ErrorLogger() << "Requested locale \"" << name << "\" is not a valid locale for this operating system";
        return std::locale::classic();
    }

    TraceLogger() << "Requested " << (name.empty() ? "(default)" : name) << " locale"
                  << " returning " << std::use_facet<boost::locale::info>(retval).name();
    return retval;
}
开发者ID:adrianbroher,项目名称:freeorion,代码行数:30,代码来源:i18n.cpp

示例6: TraceLogger

boost::statechart::result QuittingGame::react(const StartQuittingGame& u) {
    TraceLogger(FSM) << "(HumanClientFSM) QuittingGame reset to intro is " << u.m_reset_to_intro;

    m_reset_to_intro = u.m_reset_to_intro;
    m_server_process = &u.m_server;

    post_event(ShutdownServer());
    return discard_event();
}
开发者ID:MatGB,项目名称:freeorion,代码行数:9,代码来源:HumanClientFSM.cpp

示例7: Base

////////////////////////////////////////////////////////////
// MPLobby
////////////////////////////////////////////////////////////
MPLobby::MPLobby(my_context ctx) :
    Base(ctx)
{
    TraceLogger(FSM) << "(HumanClientFSM) MPLobby";

    const auto& wnd = Client().GetClientUI().GetMultiPlayerLobbyWnd();
    Client().Register(wnd);
    wnd->CleanupChat();
}
开发者ID:matt474,项目名称:freeorion,代码行数:12,代码来源:HumanClientFSM.cpp

示例8: my_base

/** The QuittingGame state expects to start with a StartQuittingGame message posted. */
QuittingGame::QuittingGame(my_context c) :
    my_base(c),
    m_start_time(Clock::now())
{
    // Quit the game by sending a shutdown message to the server and waiting for
    // the disconnection event.  Free the server if it starts an orderly
    // shutdown, otherwise kill it.

    TraceLogger(FSM) << "(Host) QuittingGame";
}
开发者ID:matt474,项目名称:freeorion,代码行数:11,代码来源:HumanClientFSM.cpp


注:本文中的TraceLogger函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。