Rework log messages

Former-commit-id: eac93c0fd78fdf353e940d08df3cabf0b962a3e2
This commit is contained in:
brindosch
2016-03-23 17:40:34 +01:00
parent dcd518b6cc
commit fa66c3b2b5
27 changed files with 147 additions and 147 deletions

View File

@@ -112,7 +112,7 @@ void Effect::run()
}
else
{
std::cerr << "Unable to open script file " << _script << std::endl;
std::cerr << "EFFECTENGINE ERROR: Unable to open script file " << _script << std::endl;
}
// Clean up the thread state
@@ -355,7 +355,7 @@ Effect * Effect::getEffect()
{
// something is wrong
Py_XDECREF(module);
std::cerr << "Unable to retrieve the effect object from the Python runtime" << std::endl;
std::cerr << "EFFECTENGINE ERROR: Unable to retrieve the effect object from the Python runtime" << std::endl;
return nullptr;
}
@@ -367,7 +367,7 @@ Effect * Effect::getEffect()
{
// something is wrong
Py_XDECREF(effectCapsule);
std::cerr << "Unable to retrieve the effect object from the Python runtime" << std::endl;
std::cerr << "EFFECTENGINE ERROR: Unable to retrieve the effect object from the Python runtime" << std::endl;
return nullptr;
}

View File

@@ -37,7 +37,7 @@ EffectEngine::EffectEngine(Hyperion * hyperion, const Json::Value & jsonEffectCo
QDir directory(QString::fromStdString(path));
if (!directory.exists())
{
std::cerr << "Effect directory can not be loaded: " << path << std::endl;
std::cerr << "EFFECTENGINE ERROR: Effect directory can not be loaded: " << path << std::endl;
continue;
}
@@ -53,7 +53,7 @@ EffectEngine::EffectEngine(Hyperion * hyperion, const Json::Value & jsonEffectCo
}
// initialize the python interpreter
std::cout << "Initializing Python interpreter" << std::endl;
std::cout << "EFFECTENGINE INFO: Initializing Python interpreter" << std::endl;
Effect::registerHyperionExtensionModule();
Py_InitializeEx(0);
PyEval_InitThreads(); // Create the GIL
@@ -63,7 +63,7 @@ EffectEngine::EffectEngine(Hyperion * hyperion, const Json::Value & jsonEffectCo
EffectEngine::~EffectEngine()
{
// clean up the Python interpreter
std::cout << "Cleaning up Python interpreter" << std::endl;
std::cout << "EFFECTENGINE INFO: Cleaning up Python interpreter" << std::endl;
PyEval_RestoreThread(_mainThreadState);
Py_Finalize();
}
@@ -84,7 +84,7 @@ bool EffectEngine::loadEffectDefinition(const std::string &path, const std::stri
if (!file.is_open())
{
std::cerr << "Effect file '" << fileName << "' could not be loaded" << std::endl;
std::cerr << "EFFECTENGINE ERROR: Effect file '" << fileName << "' could not be loaded" << std::endl;
return false;
}
@@ -93,7 +93,7 @@ bool EffectEngine::loadEffectDefinition(const std::string &path, const std::stri
Json::Value config;
if (!jsonReader.parse(file, config, false))
{
std::cerr << "Error while reading effect '" << fileName << "': " << jsonReader.getFormattedErrorMessages() << std::endl;
std::cerr << "EFFECTENGINE ERROR: Error while reading effect '" << fileName << "': " << jsonReader.getFormattedErrorMessages() << std::endl;
return false;
}
@@ -107,7 +107,7 @@ bool EffectEngine::loadEffectDefinition(const std::string &path, const std::stri
{
const std::list<std::string> & errors = schemaChecker.getMessages();
foreach (const std::string & error, errors) {
std::cerr << "Error while checking '" << fileName << "':" << error << std::endl;
std::cerr << "EFFECTENGINE ERROR: Error while checking '" << fileName << "':" << error << std::endl;
}
return false;
}
@@ -121,8 +121,8 @@ bool EffectEngine::loadEffectDefinition(const std::string &path, const std::stri
#endif
effectDefinition.args = config["args"];
// return succes
std::cout << "Effect loaded: " + effectDefinition.name << std::endl;
// return succes //BLACKLIST OUTPUT TO LOG (Spam). This is more a effect development thing and the list gets longer and longer
// std::cout << "EFFECTENGINE INFO: Effect loaded: " + effectDefinition.name << std::endl;
return true;
}
@@ -133,7 +133,7 @@ int EffectEngine::runEffect(const std::string &effectName, int priority, int tim
int EffectEngine::runEffect(const std::string &effectName, const Json::Value &args, int priority, int timeout)
{
std::cout << "run effect " << effectName << " on channel " << priority << std::endl;
std::cout << "EFFECTENGINE INFO: run effect " << effectName << " on channel " << priority << std::endl;
const EffectDefinition * effectDefinition = nullptr;
for (const EffectDefinition & e : _availableEffects)
@@ -147,7 +147,7 @@ int EffectEngine::runEffect(const std::string &effectName, const Json::Value &ar
if (effectDefinition == nullptr)
{
// no such effect
std::cerr << "effect " << effectName << " not found" << std::endl;
std::cerr << "EFFECTENGINE ERROR: effect " << effectName << " not found" << std::endl;
return -1;
}
@@ -198,7 +198,7 @@ void EffectEngine::effectFinished(Effect *effect)
_hyperion->clear(effect->getPriority());
}
std::cout << "effect finished" << std::endl;
std::cout << "EFFECTENGINE INFO: effect finished" << std::endl;
for (auto effectIt = _activeEffects.begin(); effectIt != _activeEffects.end(); ++effectIt)
{
if (*effectIt == effect)