1
This commit is contained in:
parent
3fe5d3e7a3
commit
ad4aafc4fc
@ -43,8 +43,8 @@ struct IMMsgNode
|
||||
|
||||
};
|
||||
|
||||
const char* const PROJ_LOG_ROOT = "/data/logs/%s/logs";
|
||||
const char* const PROJ_LOG_FILENAME = "log_$pid_%Y%m%d.log";
|
||||
const char* const PROJ_LOG_ROOT_FMT = "/data/logs/%s/logs";
|
||||
const char* const PROJ_LOG_FILENAME_FMT = "log_$pid_%Y%m%d.log";
|
||||
|
||||
static void SavePerfLog()
|
||||
{
|
||||
@ -397,16 +397,18 @@ void App::ProcessIMMsg()
|
||||
|
||||
void App::InitLog()
|
||||
{
|
||||
std::string filename_fmt = PROJ_LOG_FILENAME;
|
||||
std::string filename_fmt = PROJ_LOG_FILENAME_FMT;
|
||||
if (getenv("is_dev_env")) {
|
||||
a8::ReplaceString(filename_fmt, "$pid", a8::XValue(0));
|
||||
} else {
|
||||
a8::ReplaceString(filename_fmt, "$pid", a8::XValue(getpid()));
|
||||
}
|
||||
|
||||
a8::MkDir(a8::Format(PROJ_ROOT, {PROJ_NAME}));
|
||||
a8::MkDir(a8::Format(PROJ_LOG_ROOT, {PROJ_NAME}));
|
||||
a8::UdpLog::Instance()->SetLogFileName(a8::Format(PROJ_LOG_ROOT, {PROJ_NAME}) + "/" + filename_fmt);
|
||||
a8::MkDir(a8::Format(PROJ_ROOT_FMT, {a8::Format(PROJ_NAME_FMT, {GAME_ID})}));
|
||||
a8::MkDir(a8::Format(PROJ_LOG_ROOT_FMT, {a8::Format(PROJ_NAME_FMT, {GAME_ID})}));
|
||||
a8::UdpLog::Instance()->SetLogFileName(a8::Format(PROJ_LOG_ROOT_FMT,
|
||||
{a8::Format(PROJ_NAME_FMT, {GAME_ID})}) + "/" + filename_fmt
|
||||
);
|
||||
a8::UdpLog::Instance()->Init();
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ enum PlayerState_e
|
||||
PS_WaitingMatch
|
||||
};
|
||||
|
||||
const char* const PROJ_NAME = "game" A8_MACRO_STR(GAME_ID) "_gameserver";
|
||||
const char* const PROJ_ROOT = "/data/logs/%s";
|
||||
const char* const PROJ_NAME_FMT = "game%d_wsproxy";
|
||||
const char* const PROJ_ROOT_FMT = "/data/logs/%s";
|
||||
|
||||
const int POSTFIX_LEN = 7;
|
||||
|
2
third_party/a8engine
vendored
2
third_party/a8engine
vendored
@ -1 +1 @@
|
||||
Subproject commit ab6f41321c5925b5a26f4a106f784551a172ecc9
|
||||
Subproject commit 8ba8ad7c7b28920af6c978482e5a13b4327a9f80
|
Loading…
x
Reference in New Issue
Block a user