mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-09 06:48:35 -05:00
Added logging to the script engine and the associated properties in openspace.cfg table. Fixed comment for PropertyDocumentation in scene.cpp
This commit is contained in:
@@ -53,6 +53,10 @@ public:
|
||||
static const std::string KeyLuaDocumentationType;
|
||||
/// The key that stores the save location of the Lua documentation
|
||||
static const std::string KeyLuaDocumentationFile;
|
||||
/// The key that stores the type of scripting log that should be stored
|
||||
static const std::string KeyScriptLogType;
|
||||
/// The key that stores the save location of the scripting log
|
||||
static const std::string KeyScriptLogFile;
|
||||
/// The key that stores the type of Property documentation that should be stored
|
||||
static const std::string KeyPropertyDocumentationType;
|
||||
/// The key that stores the save location of the Property documentation
|
||||
|
||||
@@ -102,6 +102,8 @@ public:
|
||||
|
||||
bool writeDocumentation(const std::string& filename, const std::string& type) const;
|
||||
|
||||
bool writeLog(const std::string& script);
|
||||
|
||||
void serialize(SyncBuffer* syncBuffer);
|
||||
|
||||
void deserialize(SyncBuffer* syncBuffer);
|
||||
@@ -111,7 +113,9 @@ public:
|
||||
void preSynchronization();
|
||||
|
||||
void queueScript(const std::string &script);
|
||||
|
||||
|
||||
void setLogFile(const std::string& filename, const std::string& type);
|
||||
|
||||
std::vector<std::string> cachedScripts();
|
||||
|
||||
std::vector<std::string> allLuaFunctions() const;
|
||||
@@ -122,6 +126,7 @@ public:
|
||||
void cacheScript(const std::string &library, const std::string &function, const std::string &script);
|
||||
|
||||
private:
|
||||
|
||||
bool registerLuaLibrary(lua_State* state, const LuaLibrary& library);
|
||||
void addLibraryFunctions(lua_State* state, const LuaLibrary& library, bool replace);
|
||||
|
||||
@@ -142,6 +147,14 @@ private:
|
||||
//parallel variables
|
||||
std::map<std::string, std::map<std::string, std::string>> _cachedScripts;
|
||||
std::mutex _cachedScriptsMutex;
|
||||
|
||||
//logging variables
|
||||
bool _logFileExists = false;
|
||||
bool _logScripts = true;
|
||||
std::string _logType;
|
||||
std::string _logFilename;
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace scripting
|
||||
|
||||
Reference in New Issue
Block a user