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:
Matthew Territo
2016-06-16 17:03:48 +02:00
parent 2eab8aee28
commit 5925bd9c63
6 changed files with 99 additions and 6 deletions

View File

@@ -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

View File

@@ -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