[chronojump] Chronojump printAll will print info on log from all threads



commit 5bad765b1957d9728dabe115ed4dc72e707156a2
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Oct 24 15:29:25 2016 +0200

    Chronojump printAll will print info on log from all threads

 src/chronojump.cs |    9 +++------
 src/logB.cs       |    9 ++++++++-
 2 files changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/src/chronojump.cs b/src/chronojump.cs
index bc57360..739d219 100644
--- a/src/chronojump.cs
+++ b/src/chronojump.cs
@@ -71,6 +71,8 @@ public class ChronoJump
                //1.4.10
                Log.Start();
                LogB.Debugging = true; //now LogB.Debug will be shown. Also there will be thread info on 
Warning, Error, Information
+               if(args.Length > 0 && args[0] == "printAll")
+                       LogB.PrintAllThreads = true;
 
                var envPath = Environment.GetEnvironmentVariable ("PATH");
                var rBinPath = "";
@@ -131,12 +133,7 @@ public class ChronoJump
                LogB.Information("baseDir1:", baseDirectory);
                LogB.Information("envPath+rBinPath:", envPath + Path.PathSeparator + rBinPath);
 
-               //testing simulated session query
-               LogB.Information(Constants.SessionTable + ":" + "-1" + ":" + Constants.SessionSimulatedName + 
":" + DateTime.Today + ":" +
-                                       Constants.SportUndefinedID + ":" + Constants.SpeciallityUndefinedID + 
":" + Constants.LevelUndefinedID + ":" +
-                                       Catalog.GetString("Use this session to simulate tests.") + ":" + 
Constants.ServerUndefinedID);
-               
-       
+
                //UtilCSV.ReadValues("/tmp/chronojump-encoder-graph-input-multi.csv");  
                
                if(UtilAll.IsWindows())
diff --git a/src/logB.cs b/src/logB.cs
index 0db8ec4..4b03140 100644
--- a/src/logB.cs
+++ b/src/logB.cs
@@ -154,6 +154,13 @@ public static class LogB
        private static Dictionary<uint, DateTime> timers = new Dictionary<uint, DateTime> ();
        private static uint next_timer_id = 1;
 
+       /*
+        * Chronojump can be called with a param printAll (chronojump printAll) and then all threads will be 
printed
+        * default behaviour is to print only when on GTK thread, and messages from other threads
+        * will be stored and printed by GTK thread before what it needs to print
+        */
+       public static bool PrintAllThreads = false;
+
        private static bool debugging = false;
        public static bool Debugging {
                get {
@@ -235,7 +242,7 @@ public static class LogB
                        string lineStart = string.Format("[{5}{0} {1:00}:{2:00}:{3:00}.{4:000}]", 
TypeString(type), DateTime.Now.Hour,
                                        DateTime.Now.Minute, DateTime.Now.Second, DateTime.Now.Millisecond, 
thread_name);
 
-                       if(printNow) {
+                       if(PrintAllThreads || printNow) {
                                //try {
                                        Console.Write(lineStart);
        


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