1
This commit is contained in:
parent
7e07d0641a
commit
8f1670355f
@ -40,8 +40,8 @@ struct IMMsgNode
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const char* const PROJ_LOG_ROOT = "/data/logs/%s/logs";
|
const char* const PROJ_LOG_ROOT_FMT = "/data/logs/%s/logs";
|
||||||
const char* const PROJ_LOG_FILENAME = "log_$pid_%Y%m%d.log";
|
const char* const PROJ_LOG_FILENAME_FMT = "log_$pid_%Y%m%d.log";
|
||||||
|
|
||||||
static void SavePerfLog()
|
static void SavePerfLog()
|
||||||
{
|
{
|
||||||
@ -351,16 +351,18 @@ void App::ProcessIMMsg()
|
|||||||
|
|
||||||
void App::InitLog()
|
void App::InitLog()
|
||||||
{
|
{
|
||||||
std::string filename_fmt = PROJ_LOG_FILENAME;
|
std::string filename_fmt = PROJ_LOG_FILENAME_FMT;
|
||||||
if (getenv("is_dev_env")) {
|
if (getenv("is_dev_env")) {
|
||||||
a8::ReplaceString(filename_fmt, "$pid", a8::XValue(0));
|
a8::ReplaceString(filename_fmt, "$pid", a8::XValue(0));
|
||||||
} else {
|
} else {
|
||||||
a8::ReplaceString(filename_fmt, "$pid", a8::XValue(getpid()));
|
a8::ReplaceString(filename_fmt, "$pid", a8::XValue(getpid()));
|
||||||
}
|
}
|
||||||
|
|
||||||
a8::MkDir(a8::Format(PROJ_ROOT, {PROJ_NAME}));
|
a8::MkDir(a8::Format(PROJ_ROOT_FMT, {a8::Format(PROJ_NAME_FMT, {GAME_ID})}));
|
||||||
a8::MkDir(a8::Format(PROJ_LOG_ROOT, {PROJ_NAME}));
|
a8::MkDir(a8::Format(PROJ_LOG_ROOT_FMT, {a8::Format(PROJ_NAME_FMT, {GAME_ID})}));
|
||||||
a8::UdpLog::Instance()->SetLogFileName(a8::Format(PROJ_LOG_ROOT, {PROJ_NAME}) + "/" + filename_fmt);
|
a8::UdpLog::Instance()->SetLogFileName(a8::Format(PROJ_LOG_ROOT_FMT,
|
||||||
|
{a8::Format(PROJ_NAME_FMT, {GAME_ID})}) + "/" + filename_fmt
|
||||||
|
);
|
||||||
a8::UdpLog::Instance()->Init();
|
a8::UdpLog::Instance()->Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,6 +18,6 @@ enum NetHandler_e
|
|||||||
HID_DBPool,
|
HID_DBPool,
|
||||||
};
|
};
|
||||||
|
|
||||||
const char* const PROJ_NAME = "game" A8_MACRO_STR(GAME_ID) "_dbproxy";
|
const char* const PROJ_NAME_FMT = "game%d_dbproxy";
|
||||||
const char* const PROJ_ROOT = "/data/logs/%s";
|
const char* const PROJ_ROOT_FMT = "/data/logs/%s";
|
||||||
|
|
||||||
|
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