mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Made log messages more consistent.
This commit is contained in:
parent
f8f31a527e
commit
1e9d424c99
@ -744,9 +744,9 @@ double CConfigParser::ReadFormula(LPCTSTR section, LPCTSTR key, double defValue)
|
||||
error += ConvertToWide(errMsg);
|
||||
error += L" in key \"";
|
||||
error += key ? key : L"";
|
||||
error += L"\" in section [";
|
||||
error += L"\" in [";
|
||||
error += section ? section : L"";
|
||||
error += L"].";
|
||||
error += L"]";
|
||||
Log(LOG_ERROR, error.c_str());
|
||||
}
|
||||
|
||||
|
@ -25,17 +25,13 @@
|
||||
class CError
|
||||
{
|
||||
public:
|
||||
CError(const std::wstring& String) : m_String(String), m_File(NULL) {}
|
||||
CError(const WCHAR* String ) : m_String(String), m_File(NULL) {}
|
||||
CError(const std::wstring& String, int Line, const char* File) : m_String(String), m_Line(Line), m_File(File) {}
|
||||
CError(const WCHAR* String, int Line, const char* File) : m_String(String), m_Line(Line), m_File(File) {}
|
||||
CError(const std::wstring& String) : m_String(String) {}
|
||||
CError(const WCHAR* String ) : m_String(String) {}
|
||||
|
||||
const std::wstring& GetString();
|
||||
|
||||
private:
|
||||
std::wstring m_String;
|
||||
int m_Line;
|
||||
const char* m_File;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -836,7 +836,7 @@ CMeasure* CMeasure::Create(const WCHAR* measure, CMeterWindow* meterWindow, cons
|
||||
error += L" is not valid in [";
|
||||
error += name;
|
||||
error += L"]";
|
||||
throw CError(error, __LINE__, __FILE__);
|
||||
throw CError(error);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
@ -84,9 +84,9 @@ bool CMeasureCalc::Update()
|
||||
{
|
||||
std::wstring error = L"Calc: ";
|
||||
error += ConvertToWide(errMsg);
|
||||
error += L" in measure [";
|
||||
error += L" in [";
|
||||
error += m_Name;
|
||||
error += L"].";
|
||||
error += L"]";
|
||||
Log(LOG_ERROR, error.c_str());
|
||||
}
|
||||
|
||||
|
@ -151,7 +151,7 @@ void CMeasurePlugin::ReadConfig(CConfigParser& parser, const WCHAR* section)
|
||||
{
|
||||
std::wstring error = L"Plugin: \"" + m_PluginName;
|
||||
error += L"\" not found";
|
||||
throw CError(error, __LINE__, __FILE__);
|
||||
throw CError(error);
|
||||
}
|
||||
}
|
||||
|
||||
@ -167,8 +167,8 @@ void CMeasurePlugin::ReadConfig(CConfigParser& parser, const WCHAR* section)
|
||||
FreeLibrary(m_Plugin);
|
||||
|
||||
std::wstring error = L"Plugin: \"" + m_PluginName;
|
||||
error += L"\" doesn't export Update() or GetString()!";
|
||||
throw CError(error, __LINE__, __FILE__);
|
||||
error += L"\" doesn't export Update() or GetString()";
|
||||
throw CError(error);
|
||||
}
|
||||
|
||||
// Initialize the plugin
|
||||
|
@ -154,7 +154,7 @@ void CMeasureRegistry::ReadConfig(CConfigParser& parser, const WCHAR* section)
|
||||
error += L" is not valid in [";
|
||||
error += m_Name;
|
||||
error += L"]";
|
||||
throw CError(error, __LINE__, __FILE__);
|
||||
throw CError(error);
|
||||
}
|
||||
|
||||
m_RegKeyName = parser.ReadString(section, L"RegKey", L"");
|
||||
|
@ -462,8 +462,8 @@ void CMeter::BindMeasure(const std::list<CMeasure*>& measures)
|
||||
if (m_MeasureName.empty())
|
||||
{
|
||||
std::wstring error = L"The meter [" + m_Name;
|
||||
error += L"] is unbound!";
|
||||
throw CError(error, __LINE__, __FILE__);
|
||||
error += L"] is unbound";
|
||||
throw CError(error);
|
||||
}
|
||||
|
||||
// Go through the list and check it there is a measure for us
|
||||
@ -481,8 +481,8 @@ void CMeter::BindMeasure(const std::list<CMeasure*>& measures)
|
||||
std::wstring error = L"The meter [" + m_Name;
|
||||
error += L"] cannot be bound with [";
|
||||
error += m_MeasureName;
|
||||
error += L"]!";
|
||||
throw CError(error, __LINE__, __FILE__);
|
||||
error += L"]";
|
||||
throw CError(error);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -534,10 +534,10 @@ CMeter* CMeter::Create(const WCHAR* meter, CMeterWindow* meterWindow, const WCHA
|
||||
// Error
|
||||
std::wstring error = L"Meter=";
|
||||
error += meter;
|
||||
error += L" is not valid in section [";
|
||||
error += L" is not valid in [";
|
||||
error += name;
|
||||
error += L"].";
|
||||
throw CError(error, __LINE__, __FILE__);
|
||||
error += L"]";
|
||||
throw CError(error);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
@ -131,10 +131,10 @@ void CMeterBar::ReadConfig(CConfigParser& parser, const WCHAR* section)
|
||||
else
|
||||
{
|
||||
std::wstring error = L"BarOrientation=" + orientation;
|
||||
error += L" is not valid in meter [";
|
||||
error += L" is not valid in [";
|
||||
error += m_Name;
|
||||
error += L"].";
|
||||
throw CError(error, __LINE__, __FILE__);
|
||||
error += L"]";
|
||||
throw CError(error);
|
||||
}
|
||||
|
||||
if (m_Initialized)
|
||||
|
@ -212,10 +212,10 @@ void CMeterBitmap::ReadConfig(CConfigParser& parser, const WCHAR* section)
|
||||
else
|
||||
{
|
||||
std::wstring error = L"BitmapAlign=" + align;
|
||||
error += L" is not valid in meter [";
|
||||
error += L" is not valid in [";
|
||||
error += m_Name;
|
||||
error += L"].";
|
||||
throw CError(error, __LINE__, __FILE__);
|
||||
error += L"]";
|
||||
throw CError(error);
|
||||
}
|
||||
|
||||
if (m_Initialized)
|
||||
|
@ -529,7 +529,7 @@ void CMeterHistogram::BindMeasure(const std::list<CMeasure*>& measures)
|
||||
std::wstring error = L"The meter [" + m_Name;
|
||||
error += L"] cannot be bound with [";
|
||||
error += m_SecondaryMeasureName;
|
||||
error += L"]!";
|
||||
throw CError(error, __LINE__, __FILE__);
|
||||
error += L"]";
|
||||
throw CError(error);
|
||||
}
|
||||
}
|
||||
|
@ -388,8 +388,8 @@ void CMeterImage::BindMeasure(const std::list<CMeasure*>& measures)
|
||||
std::wstring error = L"The meter [" + m_Name;
|
||||
error += L"] cannot be bound with [";
|
||||
error += (*j);
|
||||
error += L"]!";
|
||||
throw CError(error, __LINE__, __FILE__);
|
||||
error += L"]";
|
||||
throw CError(error);
|
||||
}
|
||||
}
|
||||
CMeter::SetAllMeasures(m_Measures);
|
||||
|
@ -377,8 +377,8 @@ void CMeterLine::BindMeasure(const std::list<CMeasure*>& measures)
|
||||
std::wstring error = L"The meter [" + m_Name;
|
||||
error += L"] cannot be bound with [";
|
||||
error += (*j);
|
||||
error += L"]!";
|
||||
throw CError(error, __LINE__, __FILE__);
|
||||
error += L"]";
|
||||
throw CError(error);
|
||||
}
|
||||
}
|
||||
CMeter::SetAllMeasures(m_Measures);
|
||||
|
@ -279,7 +279,7 @@ void CMeterString::Initialize()
|
||||
if (m_FontSize != 0)
|
||||
{
|
||||
std::wstring error = L"String: Unable to create font: " + m_FontFace;
|
||||
throw CError(error, __LINE__, __FILE__);
|
||||
throw CError(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -378,10 +378,10 @@ void CMeterString::ReadConfig(CConfigParser& parser, const WCHAR* section)
|
||||
else
|
||||
{
|
||||
std::wstring error = L"StringAlign=" + align;
|
||||
error += L" is not valid in meter [";
|
||||
error += L" is not valid in [";
|
||||
error += m_Name;
|
||||
error += L"].";
|
||||
throw CError(error, __LINE__, __FILE__);
|
||||
error += L"]";
|
||||
throw CError(error);
|
||||
}
|
||||
|
||||
const std::wstring& stringCase = parser.ReadString(section, L"StringCase", L"NONE");
|
||||
@ -404,10 +404,10 @@ void CMeterString::ReadConfig(CConfigParser& parser, const WCHAR* section)
|
||||
else
|
||||
{
|
||||
std::wstring error = L"StringCase=" + stringCase;
|
||||
error += L" is not valid in meter [";
|
||||
error += L" is not valid in [";
|
||||
error += m_Name;
|
||||
error += L"].";
|
||||
throw CError(error, __LINE__, __FILE__);
|
||||
error += L"]";
|
||||
throw CError(error);
|
||||
}
|
||||
|
||||
const std::wstring& style = parser.ReadString(section, L"StringStyle", L"NORMAL");
|
||||
@ -430,10 +430,10 @@ void CMeterString::ReadConfig(CConfigParser& parser, const WCHAR* section)
|
||||
else
|
||||
{
|
||||
std::wstring error = L"StringStyle=" + style;
|
||||
error += L" is not valid in meter [";
|
||||
error += L" is not valid in [";
|
||||
error += m_Name;
|
||||
error += L"].";
|
||||
throw CError(error, __LINE__, __FILE__);
|
||||
error += L"]";
|
||||
throw CError(error);
|
||||
}
|
||||
|
||||
const std::wstring& effect = parser.ReadString(section, L"StringEffect", L"NONE");
|
||||
@ -452,10 +452,10 @@ void CMeterString::ReadConfig(CConfigParser& parser, const WCHAR* section)
|
||||
else
|
||||
{
|
||||
std::wstring error = L"StringEffect=" + effect;
|
||||
error += L" is not valid in meter [";
|
||||
error += L" is not valid in [";
|
||||
error += m_Name;
|
||||
error += L"].";
|
||||
throw CError(error, __LINE__, __FILE__);
|
||||
error += L"]";
|
||||
throw CError(error);
|
||||
}
|
||||
|
||||
if (m_Initialized &&
|
||||
@ -697,8 +697,8 @@ void CMeterString::BindMeasure(const std::list<CMeasure*>& measures)
|
||||
std::wstring error = L"The meter [" + m_Name;
|
||||
error += L"] cannot be bound with [";
|
||||
error += (*j);
|
||||
error += L"]!";
|
||||
throw CError(error, __LINE__, __FILE__);
|
||||
error += L"]";
|
||||
throw CError(error);
|
||||
}
|
||||
}
|
||||
CMeter::SetAllMeasures(m_Measures);
|
||||
|
@ -255,7 +255,7 @@ int CMeterWindow::Initialize(CRainmeter& Rainmeter)
|
||||
|
||||
if (err != 0 && ERROR_CLASS_ALREADY_EXISTS != err)
|
||||
{
|
||||
throw CError(L"Unable to register class!", __LINE__, __FILE__);
|
||||
throw CError(L"Unable to register class");
|
||||
}
|
||||
}
|
||||
|
||||
@ -274,7 +274,7 @@ int CMeterWindow::Initialize(CRainmeter& Rainmeter)
|
||||
|
||||
if (m_Window == NULL)
|
||||
{
|
||||
throw CError(L"Unable to register window!", __LINE__, __FILE__);
|
||||
throw CError(L"Unable to register window");
|
||||
}
|
||||
|
||||
setlocale(LC_NUMERIC, "C");
|
||||
@ -441,13 +441,13 @@ void CMeterWindow::Refresh(bool init, bool all)
|
||||
{
|
||||
if (0 == SetTimer(m_Window, TIMER_METER, m_WindowUpdate, NULL))
|
||||
{
|
||||
throw CError(L"Unable to set timer!", __LINE__, __FILE__);
|
||||
throw CError(L"Unable to set timer");
|
||||
}
|
||||
}
|
||||
|
||||
if (0 == SetTimer(m_Window, TIMER_MOUSE, INTERVAL_MOUSE, NULL)) // Mouse position is checked twice per sec
|
||||
{
|
||||
throw CError(L"Unable to set timer!", __LINE__, __FILE__);
|
||||
throw CError(L"Unable to set timer");
|
||||
}
|
||||
|
||||
m_Rainmeter->SetCurrentParser(NULL);
|
||||
|
@ -626,10 +626,10 @@ void CTintedImage::ReadConfig(CConfigParser& parser, const WCHAR* section)
|
||||
std::wstring error = m_ConfigArray[ConfigIndexImageCrop];
|
||||
error += L"=";
|
||||
error += crop;
|
||||
error += L" (origin) is not valid in meter [";
|
||||
error += L" (origin) is not valid in [";
|
||||
error += section;
|
||||
error += L"].";
|
||||
throw CError(error, __LINE__, __FILE__);
|
||||
error += L"]";
|
||||
throw CError(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -734,10 +734,10 @@ void CTintedImage::ReadConfig(CConfigParser& parser, const WCHAR* section)
|
||||
std::wstring error = m_ConfigArray[ConfigIndexImageFlip];
|
||||
error += L"=";
|
||||
error += flip;
|
||||
error += L" is not valid in meter [";
|
||||
error += L" is not valid in [";
|
||||
error += section;
|
||||
error += L"].";
|
||||
throw CError(error, __LINE__, __FILE__);
|
||||
error += L"]";
|
||||
throw CError(error);
|
||||
}
|
||||
|
||||
if (!m_DisableTransform)
|
||||
|
@ -100,7 +100,6 @@ static int MeterWindow_GetMeter(lua_State* L)
|
||||
{
|
||||
std::wstring error = L"Script: No such meter as ";
|
||||
error += meterName;
|
||||
error += L".";
|
||||
Log(LOG_ERROR, error.c_str());
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user