[chronojump] Better messages to LogB
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Better messages to LogB
- Date: Fri, 9 Jan 2015 17:30:00 +0000 (UTC)
commit 1d0cfddc43d3b5bc27ad60064de7abfa3385a702
Author: Xavier de Blas <xaviblas gmail com>
Date: Fri Jan 9 18:29:10 2015 +0100
Better messages to LogB
src/gui/chronojump.cs | 2 +-
src/gui/encoder.cs | 31 +++++++++++++++----------------
src/logB.cs | 8 ++++++--
src/utilEncoder.cs | 6 +++---
4 files changed, 25 insertions(+), 22 deletions(-)
---
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 93dbc66..d7885e6 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -4502,7 +4502,7 @@ public partial class ChronoJumpWindow
private void chronopicEncoderLabels(bool colorize) {
LogB.Information("at chronopicEncoderLabels");
string encoderPort = chronopicWin.GetEncoderPort();
- LogB.Information("encoderPort:", encoderPort);
+ LogB.Information("gui/chronojump.cs encoderPort:", encoderPort);
if(encoderPort != null && encoderPort != "" && encoderPort != Util.GetDefaultPort())
label_chronopic_encoder.Text = Catalog.GetString("Encoder connected");
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index b41b1ca..bf5abe9 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -476,14 +476,14 @@ public partial class ChronoJumpWindow
if(notebook_encoder_capture.CurrentPage == 1)
notebook_encoder_capture.PrevPage();
- LogB.Debug("AAAAAAAAAAAAAAA");
+ LogB.Debug("Calling encoderThreadStart for capture");
encoderProcessFinish = false;
encoderThreadStart(encoderActions.CAPTURE);
//entry_encoder_signal_comment.Text = "";
- LogB.Debug("ZZZZZZZZZZZZZZZ");
+ LogB.Debug("end of Calling encoderThreadStart for capture");
//}
}
@@ -1924,18 +1924,19 @@ public partial class ChronoJumpWindow
}
private bool runEncoderCaptureCsharpCheckPort(string port) {
- LogB.Information("00a 1");
+ LogB.Information("testing encoder port: ", port);
SerialPort sp = new SerialPort(port);
- LogB.Information("00b 1");
sp.BaudRate = 115200;
- LogB.Information("00c 1");
+ LogB.Information("testing 1: sp created");
try {
sp.Open();
+ LogB.Information("testing 2: sp opened");
sp.Close();
+ LogB.Information("testing 3: sp closed. Success!");
} catch {
+ LogB.Error("testing encoder port failed");
return false;
}
- LogB.Information("00d 1");
return true;
}
@@ -1948,13 +1949,12 @@ public partial class ChronoJumpWindow
int height=encoder_capture_signal_drawingarea.Allocation.Height;
double realHeight = 1000 * 2 *
encoderCaptureOptionsWin.spin_encoder_capture_curves_height_range.Value;
- LogB.Debug(" 00a 2 ");
+ LogB.Debug("runEncoderCaptureCsharp start");
SerialPort sp = new SerialPort(port);
- LogB.Debug(" 00b 2 ");
sp.BaudRate = 115200;
- LogB.Debug(" 00c 2 ");
+ LogB.Information("sp created");
sp.Open();
- LogB.Debug(" 00d 2 ");
+ LogB.Information("sp opened");
encoderCaptureCountdown = time;
//int recordingTime = es.Ep.Time * 1000;
@@ -2148,9 +2148,8 @@ public partial class ChronoJumpWindow
}
} while (i < (recordingTime -1) && ! encoderProcessCancel && ! encoderProcessFinish);
- LogB.Debug(" 00e ");
+ LogB.Debug("runEncoderCaptureCsharp main bucle end");
sp.Close();
- LogB.Debug(" 00f ");
if(encoderProcessCancel)
return false;
@@ -2166,6 +2165,7 @@ public partial class ChronoJumpWindow
writer.Flush();
writer.Close();
((IDisposable)writer).Dispose();
+ LogB.Debug("runEncoderCaptureCsharp ended");
return true;
}
@@ -3664,8 +3664,6 @@ public partial class ChronoJumpWindow
private void updateEncoderCaptureGraphRCalcPre(bool plotCurvesBars)
{
- LogB.Information(" PERFORMING CALCULATIONS A ");
-
//check if this helps to show bars on slow computers
if(! updatingEncoderCaptureGraphRCalc) {
updateEncoderCaptureGraphRCalc(plotCurvesBars);
@@ -3684,7 +3682,7 @@ public partial class ChronoJumpWindow
return;
updatingEncoderCaptureGraphRCalc = true;
- LogB.Information(" PERFORMING CALCULATIONS B ");
+ LogB.Information("updateEncoderCaptureGraphRCalc");
EncoderCaptureCurve ecc = (EncoderCaptureCurve) ecca.ecc[ecca.curvesDone];
LogB.Information("\n" + ecc.DirectionAsString() + " " + ecc.startFrame.ToString() + " " +
ecc.endFrame.ToString());
@@ -4409,6 +4407,7 @@ public partial class ChronoJumpWindow
} else {
new DialogMessage(Constants.MessageTypes.WARNING,
Catalog.GetString("Chronopic port is not configured."));
+ LogB.Error("Chronopic port is not configured.");
createChronopicWindow(true);
return;
@@ -4962,7 +4961,7 @@ public partial class ChronoJumpWindow
/* video stuff */
private void encoderStartVideoRecord() {
- LogB.Information("Starting video");
+ LogB.Information("Starting video if selected on preferences");
checkbutton_video_encoder.Sensitive = false;
if(preferences.videoOn) {
capturer.ClickRec();
diff --git a/src/logB.cs b/src/logB.cs
index 2393faf..8ed8aa5 100644
--- a/src/logB.cs
+++ b/src/logB.cs
@@ -6,7 +6,7 @@
//
// Copyright (C) 2005-2007 Novell, Inc.
//
-// Minor fixes by Xavier de Blas <xaviblas gmail com> 2014
+// Minor tweaks by Xavier de Blas <xaviblas gmail com> 2014,2015
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -155,7 +155,11 @@ public static class LogB
var thread_name = String.Empty;
if(Debugging) {
var thread = Thread.CurrentThread;
- thread_name = String.Format("{0} ", thread.ManagedThreadId);
+ thread_name = thread.ManagedThreadId.ToString();
+ if(thread_name == "1")
+ thread_name = "1-GTK ";
+ else
+ thread_name += " ";
}
Console.Write("[{5}{0} {1:00}:{2:00}:{3:00}.{4:000}]", TypeString(type),
DateTime.Now.Hour,
diff --git a/src/utilEncoder.cs b/src/utilEncoder.cs
index b8b039a..b74aaf1 100644
--- a/src/utilEncoder.cs
+++ b/src/utilEncoder.cs
@@ -15,7 +15,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * Copyright (C) 2004-2014 Xavier de Blas <xaviblas gmail com>
+ * Copyright (C) 2004-2015 Xavier de Blas <xaviblas gmail com>
*/
using System;
@@ -561,7 +561,7 @@ public class UtilEncoder
p.Start();
LogB.Information(p.StandardOutput.ReadToEnd());
- LogB.Error(p.StandardError.ReadToEnd());
+ LogB.Warning(p.StandardError.ReadToEnd());
p.WaitForExit();
@@ -657,7 +657,7 @@ public class UtilEncoder
p.Start();
LogB.Information(p.StandardOutput.ReadToEnd());
- LogB.Error(p.StandardError.ReadToEnd());
+ LogB.Warning(p.StandardError.ReadToEnd());
p.WaitForExit();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]