[hyena] HyenaSqliteCommand: log slow cmds when in debug mode



commit ab29e32494561606532c542f94bc44338d4bb077
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Fri Apr 22 14:54:54 2011 -0500

    HyenaSqliteCommand: log slow cmds when in debug mode

 .../Hyena.Data.Sqlite/HyenaSqliteCommand.cs        |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/Hyena.Data.Sqlite/Hyena.Data.Sqlite/HyenaSqliteCommand.cs b/Hyena.Data.Sqlite/Hyena.Data.Sqlite/HyenaSqliteCommand.cs
index 2449f4d..3d84863 100644
--- a/Hyena.Data.Sqlite/Hyena.Data.Sqlite/HyenaSqliteCommand.cs
+++ b/Hyena.Data.Sqlite/Hyena.Data.Sqlite/HyenaSqliteCommand.cs
@@ -115,6 +115,8 @@ namespace Hyena.Data.Sqlite
                 execution_ms = System.Environment.TickCount - ticks;
                 if (log_all) {
                     Log.DebugFormat ("Executed in {0}ms {1}", execution_ms, command_text);
+                } else if (Log.Debugging && execution_ms > 500) {
+                    Log.WarningFormat ("Executed in {0}ms {1}", execution_ms, command_text);
                 }
             } catch (Exception e) {
                 Log.DebugFormat ("Exception executing command: {0}", command_text ?? command);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]