new logger

scripts are now more error prone
This commit is contained in:
Eduardo Bart
2011-04-22 15:48:02 -03:00
parent e611734396
commit 96e0b1e909
30 changed files with 181 additions and 178 deletions

View File

@@ -47,7 +47,7 @@ int AnchorLine::getPos() const
return 0;
}
}
logError("anchor line of an element has expired, your UI is missconfigured");
logError("ERROR: anchor line of an element has expired, your UI is missconfigured");
return 0;
}
@@ -74,7 +74,7 @@ bool UILayout::addAnchor(EAnchorType type, const AnchorLine& anchorLine)
{
// we can never anchor with itself
if(anchorLine.getRelativeElement() == asUILayout()) {
logError("anchoring with itself is not possible");
logError("ERROR: anchoring with itself is not possible");
return false;
}
@@ -82,7 +82,7 @@ bool UILayout::addAnchor(EAnchorType type, const AnchorLine& anchorLine)
// this only happens in missconfigurations
for(auto it = m_anchoredElements.begin(); it != m_anchoredElements.end(); ++it) {
if((*it).lock() == anchorLine.getRelativeElement()) {
logError("anchoring elements with each other is not possible");
logError("ERROR: anchoring elements with each other is not possible");
return false;
}
}

View File

@@ -67,7 +67,7 @@ UIElementPtr UILoader::loadFile(const std::string& file, const UIContainerPtr& p
{
std::string fileContents = g_resources.loadTextFile(file);
if(!fileContents.size()) {
logError("Could not load ui file \"%s", file.c_str());
flogError("ERROR: Could not load ui file \"%s", file.c_str());
return UIElementPtr();
}
@@ -101,7 +101,7 @@ UIElementPtr UILoader::loadFile(const std::string& file, const UIContainerPtr& p
return element;
} catch (YAML::Exception& e) {
logError("Failed to load ui file \"%s\":\n %s", file.c_str(), e.what());
flogError("ERROR: Failed to load ui file \"%s\":\n %s", file.c_str() % e.what());
}
return UIElementPtr();

View File

@@ -38,7 +38,7 @@ void UISkins::load(const std::string& skinsFile)
{
std::string fileContents = g_resources.loadTextFile(skinsFile);
if(!fileContents.size())
logFatal("Could not load skin file \"%s", skinsFile.c_str());
flogFatal("FATAL ERROR: Could not load skin file \"%s", skinsFile.c_str());
std::istringstream fin(fileContents);
@@ -126,7 +126,7 @@ void UISkins::load(const std::string& skinsFile)
}
}
} catch (YAML::Exception& e) {
logFatal("Malformed skin file \"%s\":\n %s", skinsFile.c_str(), e.what());
flogFatal("FATAL ERROR: Malformed skin file \"%s\":\n %s", skinsFile.c_str() % e.what());
}
}
@@ -143,6 +143,6 @@ UIElementSkinPtr UISkins::getElementSkin(UI::EElementType elementType, const std
if(elementType == skin->getElementType() && name == skin->getName())
return skin;
}
logWarning("Element skin '%s' not found", name.c_str());
flogWarning("Element skin '%s' not found", name.c_str());
return UIElementSkinPtr();
}