本文整理汇总了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());
}
示例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;
}
示例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();
}
示例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();
}
示例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;
}
示例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();
}
示例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();
}
示例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";
}