Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Write to system log API from Vireo #694

Merged
merged 2 commits into from
Sep 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions source/core/library_coreHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
var coreHelpersCAPI = {
jsExecutionContextFPSync: function () {
Module.coreHelpers.jsExecutionContextFPSync.apply(undefined, arguments);
},
jsSystemLogging_WriteMessageUTF8: function () {
Module.coreHelpers.jsSystemLogging_WriteMessageUTF8.apply(undefined, arguments);
}
};

Expand Down
23 changes: 0 additions & 23 deletions source/core/module_coreHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,6 @@ var assignCoreHelpers;
fpSync(fpString);
};

Module.coreHelpers.jsSystemLogging_WriteMessageUTF8 = function (
messageTypeRef, messageDataRef,
severityTypeRef, severityDataRef) {
var messageValueRef = Module.eggShell.createValueRef(messageTypeRef, messageDataRef);
var severityValueRef = Module.eggShell.createValueRef(severityTypeRef, severityDataRef);
var message = Module.eggShell.readString(messageValueRef);
var severity = Module.eggShell.readDouble(severityValueRef);
switch (severity) {
case 0:
console.error(message);
break;
case 1:
console.warn(message);
break;
case 2:
console.info(message);
break;
default:
console.log(message);
break;
}
};

publicAPI.coreHelpers.setFPSyncFunction = function (fn) {
if (typeof fn !== 'function') {
throw new Error('FPSync must be a callable function');
Expand Down
37 changes: 0 additions & 37 deletions source/io/FileIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,6 @@

namespace Vireo {

#if kVireoOS_emscripten
extern "C" {
extern void jsSystemLogging_WriteMessageUTF8(
TypeRef messageType, StringRef * message,
TypeRef severityType, Int32 * severity);
}
#endif

typedef Int32 FileHandle;

#ifdef VIREO_FILESYSTEM
Expand Down Expand Up @@ -385,31 +377,6 @@ VIREO_FUNCTION_SIGNATURE2(Println, StaticType, void)
}
#endif
//------------------------------------------------------------
#if kVireoOS_emscripten
struct SystemLogging_WriteMessageUTF8ParamBlock : InstructionCore
{
_ParamDef(StringRef, Ignored0In);
_ParamDef(StringRef, Ignored1In);
_ParamDef(StringRef, MessageIn);
_ParamDef(Int32, SeverityIn);
_ParamDef(ErrorCluster, ErrorInOut);
NEXT_INSTRUCTION_METHOD()
};

// An instruction to enable the Write to System Log VI which uses an SLI call to SystemLogging_WriteMessageUTF8
VIREO_FUNCTION_SIGNATURET(SystemLogging_WriteMessageUTF8, SystemLogging_WriteMessageUTF8ParamBlock)
{
TypeRef typeRefInt32 = TypeManagerScope::Current()->FindType("Int32");

if (!_Param(ErrorInOut).status) {
jsSystemLogging_WriteMessageUTF8(
_Param(MessageIn)->Type(), _ParamPointer(MessageIn),
typeRefInt32, _ParamPointer(SeverityIn));
}
return _NextInstruction();
}
#endif
//------------------------------------------------------------
DEFINE_VIREO_BEGIN(FileSystem)
// Types
DEFINE_VIREO_TYPE(FileHandle, "Int32")
Expand All @@ -423,10 +390,6 @@ DEFINE_VIREO_BEGIN(FileSystem)
DEFINE_VIREO_FUNCTION(Printf, "p(i(VarArgCount)i(String)i(StaticTypeAndData))")
#endif
//--------
#if kVireoOS_emscripten
DEFINE_VIREO_FUNCTION(SystemLogging_WriteMessageUTF8, "p(i(.String) i(.String) i(.String) i(.Int32) io(ErrorCluster))")
#endif
//--------
#ifdef VIREO_FILESYSTEM
DEFINE_VIREO_FUNCTION(FileOpen, "p(i(String)i(Int32)i(Int32)o(FileHandle))")
DEFINE_VIREO_FUNCTION(FileSize, "p(i(FileHandle)o(Int32))")
Expand Down
21 changes: 0 additions & 21 deletions test-it/karma/fixtures/systemlogging/SystemLogging.via

This file was deleted.

118 changes: 0 additions & 118 deletions test-it/karma/systemlogging/SystemLogging.Test.js

This file was deleted.