[chronojump] Nicer logs
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Nicer logs
- Date: Thu, 28 May 2015 21:48:56 +0000 (UTC)
commit 95af4c2604d718218970e6ae26b7d4d94ef0830f
Author: Xavier de Blas <xaviblas gmail com>
Date: Thu May 28 21:56:30 2015 +0200
Nicer logs
src/logB.cs | 35 ++++++++++++++++++++++++++++++++---
src/sqlite/main.cs | 8 ++++----
2 files changed, 36 insertions(+), 7 deletions(-)
---
diff --git a/src/logB.cs b/src/logB.cs
index 184eeab..9ea7b90 100644
--- a/src/logB.cs
+++ b/src/logB.cs
@@ -58,7 +58,7 @@ public enum LogEntryType
Warning,
Error,
Information,
- SQL,
+ SQL, SQLon, SQLoff,
ThreadStart, ThreadEnding, ThreadEnded
}
@@ -147,11 +147,25 @@ public static class LogB
case LogEntryType.SQL:
ConsoleCrayon.ForegroundColor = ConsoleColor.Cyan;
break;
+ case LogEntryType.SQLon:
+ ConsoleCrayon.BackgroundColor = ConsoleColor.DarkCyan;
+ ConsoleCrayon.ForegroundColor = ConsoleColor.White;
+ break;
+ case LogEntryType.SQLoff:
+ ConsoleCrayon.BackgroundColor = ConsoleColor.DarkCyan;
+ ConsoleCrayon.ForegroundColor = ConsoleColor.Black;
+ break;
case LogEntryType.ThreadStart:
+ ConsoleCrayon.BackgroundColor = ConsoleColor.Green;
+ ConsoleCrayon.ForegroundColor = ConsoleColor.Black;
+ break;
case LogEntryType.ThreadEnding:
- case LogEntryType.ThreadEnded:
- ConsoleCrayon.ForegroundColor = ConsoleColor.DarkBlue;
ConsoleCrayon.BackgroundColor = ConsoleColor.Yellow;
+ ConsoleCrayon.ForegroundColor = ConsoleColor.Black;
+ break;
+ case LogEntryType.ThreadEnded:
+ ConsoleCrayon.BackgroundColor = ConsoleColor.Red;
+ ConsoleCrayon.ForegroundColor = ConsoleColor.Black;
break;
}
@@ -198,6 +212,10 @@ public static class LogB
return "Info ";
case LogEntryType.SQL:
return "SQL ";
+ case LogEntryType.SQLon:
+ return "SQL ON";
+ case LogEntryType.SQLoff:
+ return "SQL OFF";
case LogEntryType.ThreadStart:
return "Thread Start -------------------------->";
case LogEntryType.ThreadEnding:
@@ -459,6 +477,17 @@ public static class LogB
{
SQL(String.Format(format, args));
}
+
+
+ public static void SQLon()
+ {
+ Commit(LogEntryType.SQLon, null, null, false);
+ }
+
+ public static void SQLoff()
+ {
+ Commit(LogEntryType.SQLoff, null, null, false);
+ }
#endregion
diff --git a/src/sqlite/main.cs b/src/sqlite/main.cs
index 8b87fe0..7a70ff9 100644
--- a/src/sqlite/main.cs
+++ b/src/sqlite/main.cs
@@ -92,15 +92,15 @@ class Sqlite
public static void Open()
{
try {
- LogB.SQL("SQL ON");
+ LogB.SQLon();
dbcon.Open();
} catch {
LogB.SQL("-- catched --");
- LogB.SQL("SQL OFF");
+ LogB.SQLoff();
dbcon.Close();
- LogB.SQL("SQL ON");
+ LogB.SQLon();
dbcon.Open();
LogB.SQL("-- end of catched --");
@@ -108,7 +108,7 @@ class Sqlite
}
public static void Close()
{
- LogB.SQL("SQL OFF");
+ LogB.SQLoff();
dbcon.Close();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]