mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Quiet and improve some logs
This commit is contained in:
1 parent
5ef736f6a7
commit
e30b90e709
6 files changed
+67
-49
No files matched your search
@@ -630,7 +630,7 @@ bool Delete(const Path &filename, bool quiet) {
|
||||
}
|
||||
|
||||
// Returns true if successful, or path already exists.
|
||||
bool CreateDir(const Path &path) {
|
||||
bool CreateDir(const Path &path, bool quiet) {
|
||||
if (SIMULATE_SLOW_IO) {
|
||||
sleep_ms(100, "slow-io-sim");
|
||||
INFO_LOG(Log::IO, "CreateDir %s", path.c_str());
|
||||
@@ -651,11 +651,15 @@ bool CreateDir(const Path &path) {
|
||||
AndroidContentURI uri(path.ToString());
|
||||
std::string newDirName = uri.GetLastPart();
|
||||
if (uri.NavigateUp()) {
|
||||
INFO_LOG(Log::IO, "Calling Android_CreateDirectory(%s, %s)", uri.ToString().c_str(), newDirName.c_str());
|
||||
if (!quiet) {
|
||||
INFO_LOG(Log::IO, "Calling Android_CreateDirectory(%s, %s)", uri.ToString().c_str(), newDirName.c_str());
|
||||
}
|
||||
return Android_CreateDirectory(uri.ToString(), newDirName) == StorageError::SUCCESS;
|
||||
} else {
|
||||
// Bad path - can't create this directory.
|
||||
WARN_LOG(Log::IO, "CreateDir failed: '%s'", path.c_str());
|
||||
if (!quiet) {
|
||||
WARN_LOG(Log::IO, "CreateDir failed: '%s'", path.c_str());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -686,10 +690,14 @@ bool CreateDir(const Path &path) {
|
||||
|
||||
DWORD error = GetLastError();
|
||||
if (error == ERROR_ALREADY_EXISTS) {
|
||||
DEBUG_LOG(Log::IO, "CreateDir: CreateDirectory failed on %s: already exists", path.c_str());
|
||||
if (!quiet) {
|
||||
DEBUG_LOG(Log::IO, "CreateDir: CreateDirectory failed on %s: already exists", path.c_str());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
ERROR_LOG(Log::IO, "CreateDir: CreateDirectory failed on %s: %08x %s", path.c_str(), (uint32_t)error, GetStringErrorMsg(error).c_str());
|
||||
if (!quiet) {
|
||||
ERROR_LOG(Log::IO, "CreateDir: CreateDirectory failed on %s: %08x %s", path.c_str(), (uint32_t)error, GetStringErrorMsg(error).c_str());
|
||||
}
|
||||
return false;
|
||||
#else
|
||||
if (mkdir(path.ToString().c_str(), 0755) == 0) {
|
||||
@@ -698,11 +706,15 @@ bool CreateDir(const Path &path) {
|
||||
|
||||
int err = errno;
|
||||
if (err == EEXIST) {
|
||||
DEBUG_LOG(Log::IO, "CreateDir: mkdir failed on %s: already exists", path.c_str());
|
||||
if (!quiet) {
|
||||
DEBUG_LOG(Log::IO, "CreateDir: mkdir failed on %s: already exists", path.c_str());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
ERROR_LOG(Log::IO, "CreateDir: mkdir failed on %s: %s", path.c_str(), strerror(err));
|
||||
if (!quiet) {
|
||||
ERROR_LOG(Log::IO, "CreateDir: mkdir failed on %s: %s", path.c_str(), strerror(err));
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ uint64_t GetFileSize(FILE *f);
|
||||
uint64_t ComputeRecursiveDirectorySize(const Path &path);
|
||||
|
||||
// Returns true if successful, or path already exists.
|
||||
bool CreateDir(const Path &filename);
|
||||
bool CreateDir(const Path &filename, bool quiet = false);
|
||||
|
||||
void ChangeMTime(const Path &path, time_t mtime);
|
||||
|
||||
|
||||
+36
-36
@@ -69,50 +69,50 @@ void GenericLog(Log type, LogLevel level, const char *file, int line, const char
|
||||
|
||||
// NOTE: Needs to be kept in sync with the Log enum.
|
||||
static const char * const g_logTypeNames[] = {
|
||||
"SYSTEM",
|
||||
"BOOT",
|
||||
"COMMON",
|
||||
"System",
|
||||
"Boot",
|
||||
"Common",
|
||||
"CPU",
|
||||
"FILESYS",
|
||||
"FileSystem",
|
||||
"G3D",
|
||||
"TEXCACHE",
|
||||
"TexCache",
|
||||
"HLE",
|
||||
"JIT",
|
||||
"LOADER",
|
||||
"MPEG",
|
||||
"ATRAC",
|
||||
"ME", // Rest of the media Engine
|
||||
"MEMMAP",
|
||||
"SASMIX",
|
||||
"SAVESTATE",
|
||||
"FRAMEBUF",
|
||||
"AUDIO",
|
||||
"Loader",
|
||||
"Mpeg",
|
||||
"Atrac",
|
||||
"ME",
|
||||
"MemMap",
|
||||
"SasMix",
|
||||
"SaveState",
|
||||
"FrameBuf",
|
||||
"Audio",
|
||||
"IO",
|
||||
"ACHIEVEMENTS",
|
||||
"Achievements",
|
||||
"HTTP",
|
||||
"PRINTF",
|
||||
"TEXREPLACE",
|
||||
"DEBUGGER",
|
||||
"GEDEBUGGER",
|
||||
"Printf",
|
||||
"TexReplacement",
|
||||
"Debugger",
|
||||
"GeDebugger",
|
||||
"UI",
|
||||
"IAP",
|
||||
"CWCHEATS",
|
||||
"NET",
|
||||
"SCEAUDIO",
|
||||
"SCECTRL",
|
||||
"SCEDISP",
|
||||
"SCEFONT",
|
||||
"SCEGE",
|
||||
"SCEINTC",
|
||||
"SCEIO",
|
||||
"SCEKERNEL",
|
||||
"SCEMODULE",
|
||||
"SCENET",
|
||||
"SCERTC",
|
||||
"SCESAS",
|
||||
"SCEUTIL",
|
||||
"SCEMISC",
|
||||
"SCEREG",
|
||||
"CwCheats",
|
||||
"Net",
|
||||
"sceAudio",
|
||||
"sceCtrl",
|
||||
"sceDisplay",
|
||||
"sceFont",
|
||||
"sceGe",
|
||||
"sceIntc",
|
||||
"sceIo",
|
||||
"sceKernel",
|
||||
"sceModule",
|
||||
"sceNet",
|
||||
"sceRtc",
|
||||
"sceSas",
|
||||
"sceUtility",
|
||||
"sceMisc",
|
||||
"sceReg",
|
||||
};
|
||||
|
||||
const char *LogManager::GetLogTypeName(Log type) {
|
||||
|
||||
+8
-2
@@ -213,8 +213,14 @@ int CommandLineOptions::PrintUsage(const char *progname, const char *situationTe
|
||||
}
|
||||
}
|
||||
|
||||
PRINT_STDOUT("Usage: %s [options] [FILE]\n\n", progname);
|
||||
PRINT_STDOUT("Launches FILE (e.g. ISO image) if present.\n");
|
||||
if (mode == CmdLineMode::Application) {
|
||||
PRINT_STDOUT("Usage: %s [options] [FILE]\n\n", progname);
|
||||
} else {
|
||||
PRINT_STDOUT("Usage: %s [options] [FILE1] [FILE2] [FILE3]...\n\n", progname);
|
||||
}
|
||||
|
||||
PRINT_STDOUT("Launches FILE (for example, an ISO image) if present.\n");
|
||||
PRINT_STDOUT("See headless/README.md for more details.\n\n");
|
||||
PRINT_STDOUT("Options:\n");
|
||||
PRINT_STDOUT(" -h, --help show this message and exit\n");
|
||||
PRINT_STDOUT(" --version show version information and exit\n");
|
||||
|
||||
@@ -60,6 +60,7 @@ struct KeyValue {
|
||||
// TODO: /DATA/FONT/PROPERTY could just be generated from our fontRegistry in sceFont.cpp.
|
||||
|
||||
// Partial dump of the PSP registry using tests/misc/reg.prx in pspautotests
|
||||
// TODO: We will need something more dynamic if we want to support writes, too.
|
||||
|
||||
// Dump of /DATA/FONT/PROPERTY/INFO0
|
||||
static const KeyValue tree_DATA_FONT_PROPERTY_INFO0[] = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
// Headless version of PPSSPP, for testing using http://code.google.com/p/pspautotests/ .
|
||||
// See headless.txt.
|
||||
// See headless/README.md.
|
||||
// To build on non-windows systems, just run CMake in the SDL directory, it will build both a normal ppsspp and the headless version.
|
||||
//
|
||||
// Example command line to run a test in the VS debugger (useful to debug failures):
|
||||
@@ -134,7 +134,6 @@ int printUsage(const CommandLineOptions &options, const char *progname, const ch
|
||||
fprintf(stderr, " --max-mse=NUMBER maximum allowed MSE error for screenshot\n");
|
||||
fprintf(stderr, " --timeout=SECONDS abort test it if takes longer than SECONDS\n");
|
||||
fprintf(stderr, " --ir use ir interpreter\n");
|
||||
fprintf(stderr, "\nSee headless.txt for details.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -615,7 +614,7 @@ int main(int argc, const char* argv[]) {
|
||||
#if PPSSPP_PLATFORM(WINDOWS)
|
||||
// Mount a filesystem
|
||||
g_Config.memStickDirectory = exePath / "memstick";
|
||||
File::CreateDir(g_Config.memStickDirectory);
|
||||
File::CreateDir(g_Config.memStickDirectory, true);
|
||||
CreateSysDirectories();
|
||||
#elif !PPSSPP_PLATFORM(ANDROID)
|
||||
g_Config.memStickDirectory = Path(std::string(getenv("HOME"))) / ".ppsspp";
|
||||
|
||||
Reference in new issue
Block a user