[chronojump] Trying automatic logs with standard error
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Trying automatic logs with standard error
- Date: Mon, 22 Dec 2014 13:03:08 +0000 (UTC)
commit c9b088efc78db6dc044dc467344dbffe71c5ae01
Author: Xavier de Blas <xaviblas gmail com>
Date: Mon Dec 22 14:02:49 2014 +0100
Trying automatic logs with standard error
glade/chronojump.glade | 72 ++++++++++++++++++++++++++++++++++++++++++++++++
src/chronojump.cs | 5 +--
src/gui/chronojump.cs | 2 +-
src/log.cs | 17 ++++++++++-
4 files changed, 89 insertions(+), 7 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index ab52163..7ac7ef7 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -923,6 +923,21 @@
<property name="position">0</property>
</packing>
</child>
+ <child>
+ <widget class="GtkButton" id="button_crash">
+ <property name="label">CRASH_ME
+(debug purposes)</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <signal name="clicked" handler="on_debug_crash_activate" swapped="no"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
@@ -6348,6 +6363,9 @@ Second Chronopic to platforms.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">True</property>
@@ -7087,6 +7105,9 @@ Second Chronopic to platforms.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
<child>
@@ -8078,6 +8099,9 @@ Second Chronopic to platforms.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="position">2</property>
@@ -8710,6 +8734,9 @@ Second Chronopic to platforms.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="position">4</property>
@@ -18477,6 +18504,9 @@ by you</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -19017,6 +19047,9 @@ by you</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -20049,6 +20082,9 @@ by you</property>
<placeholder/>
</child>
<child>
+ <placeholder/>
+ </child>
+ <child>
<widget class="GtkButton" id="button_video_url">
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -20138,6 +20174,9 @@ by you</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">True</property>
@@ -29066,6 +29105,24 @@ options</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -30986,6 +31043,9 @@ To differentiate between male and female, use the values 1/0, or m/f, or M/F on
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -31564,6 +31624,9 @@ To differentiate between male and female, use the values 1/0, or m/f, or M/F on
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -34136,6 +34199,9 @@ show elevation as:</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="left_attach">2</property>
@@ -34340,6 +34406,9 @@ show elevation as:</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
@@ -34559,6 +34628,9 @@ show elevation as:</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
diff --git a/src/chronojump.cs b/src/chronojump.cs
index 6df47e0..52f1a0a 100644
--- a/src/chronojump.cs
+++ b/src/chronojump.cs
@@ -68,12 +68,9 @@ public class ChronoJump
//comment this 4 lines to deactivated log, and use console.
//works better on a sudden crash
- StreamWriter sw = new StreamWriter(new BufferedStream(new FileStream(errorFile,
FileMode.Create)));
- System.Console.SetOut(sw);
- System.Console.SetError(sw);
- sw.AutoFlush = true;
*/
+
//1.4.10
Log.Start();
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index a608557..edc1492 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -6264,7 +6264,7 @@ Console.WriteLine("X");
*/
private void on_debug_crash_activate (object o, EventArgs args) {
- bool voluntaryCrashAllowed = false;
+ bool voluntaryCrashAllowed = true;
if(voluntaryCrashAllowed) {
ConfirmWindow confirmWin = ConfirmWindow.Show(Catalog.GetString("Done for testing
purposes. Chronojump will exit badly"), "", "Are you sure you want to crash application?");
confirmWin.Button_accept.Clicked += new EventHandler(crashing);
diff --git a/src/log.cs b/src/log.cs
index 87b5382..97b5697 100644
--- a/src/log.cs
+++ b/src/log.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-2009 Xavier de Blas <xaviblas gmail com>
+ * Copyright (C) 2004-2014 Xavier de Blas <xaviblas gmail com>
*/
using System;
@@ -129,7 +129,7 @@ public class Log
return;
}
}
-
+
string filename = UtilAll.GetLogFileCurrent();
string filenameOld = UtilAll.GetLogFileOld();
@@ -140,10 +140,23 @@ public class Log
} catch {}
}
+ /*
try {
writer = File.CreateText(filename);
useConsole = false;
} catch {}
+ */
+
+
+ //this does not write until exit
+ //StreamWriter sw = new StreamWriter(new BufferedStream(new
FileStream(UtilAll.GetLogFileCurrent(), FileMode.Create)));
+
+ //this writes all the time
+ StreamWriter sw = new StreamWriter(new FileStream(UtilAll.GetLogFileCurrent(),
FileMode.Create));
+
+ System.Console.SetOut(sw);
+ System.Console.SetError(sw);
+ sw.AutoFlush = true;
}
public static void Write(string text)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]