GUI: Added file monitor log

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4185 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson
2009-09-03 20:00:09 +00:00
parent 2b1022f152
commit a69eb43019
13 changed files with 50 additions and 25 deletions

View File

@ -36,6 +36,7 @@ enum LOG_TYPE {
COMMON,
CONSOLE,
DISCIO,
FILEMON,
DSPHLE,
DSPLLE,
DSP_MAIL,

View File

@ -34,6 +34,7 @@ LogManager::LogManager() : logMutex(1) {
m_Log[LogTypes::BOOT] = new LogContainer("BOOT", "Boot");
m_Log[LogTypes::COMMON] = new LogContainer("COMMON", "Common");
m_Log[LogTypes::DISCIO] = new LogContainer("DIO", "Disc IO");
m_Log[LogTypes::FILEMON] = new LogContainer("FileMon", "File Monitor");
m_Log[LogTypes::PAD] = new LogContainer("PAD", "Pad");
m_Log[LogTypes::PIXELENGINE] = new LogContainer("PE", "PixelEngine");
m_Log[LogTypes::COMMANDPROCESSOR] = new LogContainer("CP", "CommandProc");
@ -148,7 +149,7 @@ void LogContainer::removeListener(LogListener *listener) {
bool LogContainer::isListener(LogListener *listener) const {
std::vector<LogListener *>::const_iterator i;
for(i = listeners.begin(); i != listeners.end(); i++) {
for (i = listeners.begin(); i != listeners.end(); i++) {
if ((*i) == listener) {
return true;
}

View File

@ -133,13 +133,13 @@ private:
class LogManager
{
private:
LogContainer* m_Log[LogTypes::NUMBER_OF_LOGS];
Common::CriticalSection logMutex;
FileLogListener *m_fileLog;
ConsoleListener *m_consoleLog;
static LogManager *m_logManager; // Singleton. Ugh.
public:
LogContainer* m_Log[LogTypes::NUMBER_OF_LOGS];
static u32 GetMaxLevel() { return MAX_LOGLEVEL; }
void Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type,

View File

@ -439,23 +439,27 @@ int ChooseStringFrom(const char* str, const char* * items)
}
// Thousand separator. Turns 12345678 into 12,345,678.
std::string ThS(int Integer, bool Unsigned)
// Thousand separator. Turns 12345678 into 12,345,678
std::string ThS(int Integer, bool Unsigned, int Spaces)
{
// Create storage space
char cbuf[20];
// Determine treatment of signed or unsigned
if(Unsigned) sprintf(cbuf, "%u", Integer); else sprintf(cbuf, "%i", Integer);
std::string sbuf = cbuf;
for (u32 i = 0; i < sbuf.length(); ++i)
std::string Sbuf = cbuf;
for (u32 i = 0; i < Sbuf.length(); ++i)
{
if((i & 3) == 3)
{
sbuf.insert(sbuf.length() - i, ",");
Sbuf.insert(Sbuf.length() - i, ",");
}
}
return sbuf;
// Spaces
std::string Spc = "";
for (int i = 0; i < (Spaces - Sbuf.length()); i++) Spc += " ";
return Spc + Sbuf;
}
void NormalizeDirSep(std::string* str)

View File

@ -50,8 +50,8 @@ inline void CharArrayFromFormat(char (& out)[Count], const char* format, ...)
std::string StripSpaces(const std::string &s);
std::string StripQuotes(const std::string &s);
std::string StripNewline(const std::string &s);
std::string ThS(int a, bool b = true); // thousand separator
// Thousand separator. Turns 12345678 into 12,345,678
std::string ThS(int a, bool b = true, int Spaces = 0);
std::string StringFromInt(int value);
std::string StringFromBool(bool value);