Skip to content

Commit

Permalink
Varargs for WriteLog
Browse files Browse the repository at this point in the history
  • Loading branch information
Natashi committed Aug 3, 2020
1 parent 523b9bb commit 0fc5f01
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions source/GcLib/gstd/ScriptClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function const commonFunction[] =
{ "GetCurrentDateTimeS", ScriptClientBase::Func_GetCurrentDateTimeS, 0 },

//共通関数:デバッグ関連
{ "WriteLog", ScriptClientBase::Func_WriteLog, 1 },
{ "WriteLog", ScriptClientBase::Func_WriteLog, -2 }, //0 fixed + ... -> 1 minimum
{ "RaiseError", ScriptClientBase::Func_RaiseError, 1 },

//共通関数:共通データ
Expand Down Expand Up @@ -1455,7 +1455,12 @@ value ScriptClientBase::Func_GetCurrentDateTimeS(script_machine* machine, int ar

//共通関数:デバッグ関連
value ScriptClientBase::Func_WriteLog(script_machine* machine, int argc, const value* argv) {
std::wstring msg = argv->as_string();
std::wstring msg = L"";
for (int i = 0; i < argc; ) {
msg += argv[i].as_string();
if ((++i) >= argc) break;
msg += L",";
}
Logger::WriteTop(msg);
return value();
}
Expand Down

0 comments on commit 0fc5f01

Please sign in to comment.