From 48e9e81747c87835bef5a8f9e513a853ec499cad Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Wed, 14 Aug 2019 12:02:04 -0230 Subject: [PATCH] Convert remaining Logger functions to new API: fixes #515. --- src/common/SoundNull.hxx | 2 +- .../repository/sqlite/KeyValueRepositorySqlite.cxx | 9 +++++---- src/common/repository/sqlite/SettingsDb.cxx | 2 +- src/common/repository/sqlite/SqliteDatabase.cxx | 8 ++++---- src/libretro/SoundLIBRETRO.cxx | 10 +++++----- 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/common/SoundNull.hxx b/src/common/SoundNull.hxx index 74e83415d..a7f623a5f 100644 --- a/src/common/SoundNull.hxx +++ b/src/common/SoundNull.hxx @@ -40,7 +40,7 @@ class SoundNull : public Sound */ explicit SoundNull(OSystem& osystem) : Sound(osystem) { - Logger::log("Sound disabled.\n", 1); + Logger::info("Sound disabled.\n"); } /** diff --git a/src/common/repository/sqlite/KeyValueRepositorySqlite.cxx b/src/common/repository/sqlite/KeyValueRepositorySqlite.cxx index c6155e258..1d6bc2229 100644 --- a/src/common/repository/sqlite/KeyValueRepositorySqlite.cxx +++ b/src/common/repository/sqlite/KeyValueRepositorySqlite.cxx @@ -26,7 +26,8 @@ KeyValueRepositorySqlite::KeyValueRepositorySqlite( const string& tableName ) : myTableName(tableName), myDb(db) -{} +{ +} // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - std::map KeyValueRepositorySqlite::load() @@ -42,7 +43,7 @@ std::map KeyValueRepositorySqlite::load() myStmtSelect->reset(); } catch (SqliteError err) { - Logger::log(err.message, 1); + Logger::info(err.message); } return values; @@ -68,7 +69,7 @@ void KeyValueRepositorySqlite::save(const std::map& values) tx.commit(); } catch (SqliteError err) { - Logger::log(err.message, 1); + Logger::info(err.message); } } @@ -86,7 +87,7 @@ void KeyValueRepositorySqlite::save(const string& key, const Variant& value) myStmtInsert->reset(); } catch (SqliteError err) { - Logger::log(err.message, 1); + Logger::info(err.message); } } diff --git a/src/common/repository/sqlite/SettingsDb.cxx b/src/common/repository/sqlite/SettingsDb.cxx index 4d933366a..3c48d47a2 100644 --- a/src/common/repository/sqlite/SettingsDb.cxx +++ b/src/common/repository/sqlite/SettingsDb.cxx @@ -38,7 +38,7 @@ bool SettingsDb::initialize() mySettingsRepository->initialize(); } catch (SqliteError err) { - Logger::log("sqlite DB " + myDb->fileName() + " failed to initialize: " + err.message, 1); + Logger::info("sqlite DB " + myDb->fileName() + " failed to initialize: " + err.message); myDb.reset(); mySettingsRepository.reset(); diff --git a/src/common/repository/sqlite/SqliteDatabase.cxx b/src/common/repository/sqlite/SqliteDatabase.cxx index c30964c34..6a618a312 100644 --- a/src/common/repository/sqlite/SqliteDatabase.cxx +++ b/src/common/repository/sqlite/SqliteDatabase.cxx @@ -55,7 +55,7 @@ void SqliteDatabase::initialize() dbInitialized = sqlite3_exec(myHandle, "PRAGMA schema_version", nullptr, nullptr, nullptr) == SQLITE_OK; if (!dbInitialized && tries == 1) { - Logger::log("sqlite DB " + myDatabaseFile + " seems to be corrupt, removing and retrying...", 1); + Logger::info("sqlite DB " + myDatabaseFile + " seems to be corrupt, removing and retrying..."); remove(myDatabaseFile.c_str()); if (myHandle) sqlite3_close_v2(myHandle); @@ -75,7 +75,7 @@ void SqliteDatabase::initialize() throw SqliteError("unable to initialize sqlite DB for unknown reason"); }; - Logger::log("successfully opened " + myDatabaseFile, 2); + Logger::debug("successfully opened " + myDatabaseFile); exec("PRAGMA journal_mode=WAL"); @@ -84,11 +84,11 @@ void SqliteDatabase::initialize() break; case SQLITE_MISUSE: - Logger::log("failed to checkpoint WAL on " + myDatabaseFile + " - WAL probably unavailable", 1); + Logger::info("failed to checkpoint WAL on " + myDatabaseFile + " - WAL probably unavailable"); break; default: - Logger::log("failed to checkpoint WAL on " + myDatabaseFile + " : " + sqlite3_errmsg(myHandle), 1); + Logger::info("failed to checkpoint WAL on " + myDatabaseFile + " : " + sqlite3_errmsg(myHandle)); break; } } diff --git a/src/libretro/SoundLIBRETRO.cxx b/src/libretro/SoundLIBRETRO.cxx index 2e0ae8922..cac6478cd 100644 --- a/src/libretro/SoundLIBRETRO.cxx +++ b/src/libretro/SoundLIBRETRO.cxx @@ -42,8 +42,8 @@ SoundLIBRETRO::SoundLIBRETRO(OSystem& osystem, AudioSettings& audioSettings) myUnderrun(false), myAudioSettings(audioSettings) { - Logger::log("SoundLIBRETRO::SoundLIBRETRO started ...", 2); - Logger::log("SoundLIBRETRO::SoundLIBRETRO initialized", 2); + Logger::debug("SoundLIBRETRO::SoundLIBRETRO started ..."); + Logger::debug("SoundLIBRETRO::SoundLIBRETRO initialized"); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -57,7 +57,7 @@ void SoundLIBRETRO::open(shared_ptr audioQueue, { myEmulationTiming = emulationTiming; - Logger::log("SoundLIBRETRO::open started ...", 2); + Logger::debug("SoundLIBRETRO::open started ..."); audioQueue->ignoreOverflows(!myAudioSettings.enabled()); @@ -65,7 +65,7 @@ void SoundLIBRETRO::open(shared_ptr audioQueue, myUnderrun = true; myCurrentFragment = nullptr; - Logger::log("SoundLIBRETRO::open finished", 2); + Logger::debug("SoundLIBRETRO::open finished"); myIsInitializedFlag = true; } @@ -79,7 +79,7 @@ void SoundLIBRETRO::close() myAudioQueue.reset(); myCurrentFragment = nullptr; - Logger::log("SoundLIBRETRO::close", 2); + Logger::debug("SoundLIBRETRO::close"); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -