[LYN-7245] AP unit test segfault - Clean up debug messages (#5192)

* Added newline to debug prints.  Added additional debug prints based on previous segfault log

Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>

* Add more debug messaging

Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>

* Add db path to output

Signed-off-by: amzn-mike <80125227+amzn-mike@users.noreply.github.com>
This commit is contained in:
amzn-mike
2021-11-02 12:51:36 -05:00
committed by GitHub
parent e11b1e2c9c
commit 3d61db8d1d
2 changed files with 14 additions and 9 deletions
@@ -1067,12 +1067,15 @@ namespace AssetProcessor
if (dropAllTables)
{
AZ_TracePrintf("AssetDatabase", "Closing existing db connection\n"); // Temporary debug output to help with tracking down a crash
// drop all tables by destroying the entire database.
m_databaseConnection->Close();
AZ_TracePrintf("AssetDatabase", "Getting db file path\n"); // Temporary debug output to help with tracking down a crash
AZStd::string dbFilePath = GetAssetDatabaseFilePath();
if (dbFilePath != ":memory:")
{
AZ_TracePrintf("AssetDatabase", "Deleting existing db %s\n", dbFilePath.c_str()); // Temporary debug output to help with tracking down a crash
// you cannot delete a memory database, but it drops all data when you close it anyway.
if (!AZ::IO::SystemFile::Delete(dbFilePath.c_str()))
{
@@ -1082,7 +1085,7 @@ namespace AssetProcessor
return false;
}
}
AZ_TracePrintf("AssetDatabase", "Re-opening connection\n"); // Temporary debug output to help with tracking down a crash
if (!m_databaseConnection->Open(dbFilePath, IsReadOnly()))
{
delete m_databaseConnection;