diff --git a/client/src/main.cpp b/client/src/main.cpp index b0feef2c..f66faf5d 100644 --- a/client/src/main.cpp +++ b/client/src/main.cpp @@ -114,3 +114,15 @@ ALTV_JS_EXPORT const char* GetSDKHash() { return ALT_SDK_VERSION; } + +#ifndef ALTV_JS_SHARED +namespace alt +{ + v8::Platform* GetV8Platform(); +} + +v8::Platform* alt::GetV8Platform() +{ + return CV8ScriptRuntime::Instance().GetPlatform(); +} +#endif diff --git a/shared/Log.cpp b/shared/Log.cpp index 2df79e32..1898a61c 100644 --- a/shared/Log.cpp +++ b/shared/Log.cpp @@ -8,6 +8,8 @@ Log& Log::Endl(Log& log) { + auto& core = alt::ICore::Instance(); + v8::Isolate* isolate = nullptr; #ifdef ALT_CLIENT_API isolate = CV8ScriptRuntime::Instance().GetIsolate(); @@ -22,11 +24,11 @@ Log& Log::Endl(Log& log) switch(log.type) { - case INFO: alt::ICore::Instance().LogInfo(log.buf.str(), resource); break; - case DEBUG: alt::ICore::Instance().LogDebug(log.buf.str().c_str(), resource); break; - case WARNING: alt::ICore::Instance().LogWarning(log.buf.str().c_str(), resource); break; - case ERR: alt::ICore::Instance().LogError(log.buf.str().c_str(), resource); break; - case COLORED: alt::ICore::Instance().LogColored(log.buf.str().c_str(), resource); break; + case INFO: core.LogInfo(LOG_PREFIX, log.buf.str(), resource); break; + case DEBUG: core.LogDebug(LOG_PREFIX, log.buf.str().c_str(), resource); break; + case WARNING: core.LogWarning(LOG_PREFIX, log.buf.str().c_str(), resource); break; + case ERR: core.LogError(LOG_PREFIX, log.buf.str().c_str(), resource); break; + case COLORED: core.LogColored(LOG_PREFIX, log.buf.str().c_str(), resource); break; } log.buf.str(""); diff --git a/shared/Log.h b/shared/Log.h index cd17899c..7ecca8c6 100644 --- a/shared/Log.h +++ b/shared/Log.h @@ -22,6 +22,8 @@ class Log Log() = default; public: + static constexpr const char* LOG_PREFIX = "[js]"; + Log(const Log&) = delete; Log(Log&&) = delete; Log& operator=(const Log&) = delete; diff --git a/shared/V8ResourceImpl.cpp b/shared/V8ResourceImpl.cpp index 118776eb..5043a3e0 100644 --- a/shared/V8ResourceImpl.cpp +++ b/shared/V8ResourceImpl.cpp @@ -652,17 +652,17 @@ static void PrintLog(const v8::FunctionCallbackInfo& info) { case 0: { - alt::ICore::Instance().LogColored(stream.str(), resource->GetResource()); + alt::ICore::Instance().LogColored(Log::LOG_PREFIX, stream.str(), resource->GetResource()); break; } case 1: { - alt::ICore::Instance().LogWarning(stream.str(), resource->GetResource()); + alt::ICore::Instance().LogWarning(Log::LOG_PREFIX, stream.str(), resource->GetResource()); break; } case 2: { - alt::ICore::Instance().LogError(stream.str(), resource->GetResource()); + alt::ICore::Instance().LogError(Log::LOG_PREFIX, stream.str(), resource->GetResource()); break; } } diff --git a/shared/deps/cpp-sdk b/shared/deps/cpp-sdk index b1ced940..b7825258 160000 --- a/shared/deps/cpp-sdk +++ b/shared/deps/cpp-sdk @@ -1 +1 @@ -Subproject commit b1ced94027a7b3c0c2167b12e45da80b49c8527b +Subproject commit b7825258fafcb6d9aa3906b41e27cfe2d8bf93af