Merge lp:~marcus-lundgren/granite/fix-1008009-1012077 into lp:~elementary-pantheon/granite/granite

Proposed by Cody Garver
Status: Merged
Merged at revision: 276
Proposed branch: lp:~marcus-lundgren/granite/fix-1008009-1012077
Merge into: lp:~elementary-pantheon/granite/granite
Diff against target: 32 lines (+6/-6)
1 file modified
lib/Services/Logger.vala (+6/-6)
To merge this branch: bzr merge lp:~marcus-lundgren/granite/fix-1008009-1012077
Reviewer Review Type Date Requested Status
Rico Tzschichholz Approve
xapantu Pending
Review via email: mp+110694@code.launchpad.net

This proposal supersedes a proposal from 2012-06-12.

To post a comment you must log in.
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote : Posted in a previous version of this proposal

This is in fact a direct copypaste from Varka and a fix for bug #958914, the root cause of those bugs

Revision history for this message
xapantu (xapantu) wrote : Posted in a previous version of this proposal

Looks good to me :)

Feel free to merge it if it works :)

review: Approve
Revision history for this message
Rico Tzschichholz (ricotz) wrote :

The copyright statement is wrong, this is coming from plank NOT varka.

I am bit concerned about abi breaks here which should be looked into. And should lead to a soname bump if it is the case.

269. By Marcus Lundgren

Replaced function bodies with the ones present in plank.

270. By Marcus Lundgren

Cleaning up the diff.

271. By Marcus Lundgren

Cleaning up the diff.

272. By Marcus Lundgren

'Fixed' the problem with renaming files. Read comments in the source for information.

273. By Marcus Lundgren

Changed parameters in print_log.

274. By Marcus Lundgren

Clean up.

275. By Marcus Lundgren

Clean up.

Revision history for this message
Rico Tzschichholz (ricotz) wrote :

looks clean and easy enough now

review: Approve
Revision history for this message
Marcus Lundgren (marcus-lundgren) wrote :

*For future reference* This is not a direct copy of plank's logger, as it had the same problem as before. The fix is my own creation, as I noticed that creating new LogMessages in the write method threw an exception during certain circumstances. This is why the print_log method is changed to handle a LogLevel and a string instead of a LogMessage.

While I am at it, I don't think this actually fixes the threading problem in the logger, as the enqueuing will try and create a new LogMessage which might throw a similar exception (I was unable to reach this place in the logger during my testing). It is however possible that it will work, since creating a new LogMessage works most of the time, as that is how it worked before this branch was merged.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/Services/Logger.vala'
2--- lib/Services/Logger.vala 2012-06-17 17:34:38 +0000
3+++ lib/Services/Logger.vala 2012-06-17 23:55:24 +0000
4@@ -123,22 +123,22 @@
5 log_queue = new List<LogMessage> ();
6
7 foreach (var log in logs)
8- print_log (log);
9+ print_log (log.Level, log.Message);
10 }
11
12- print_log (new LogMessage (level, msg));
13+ print_log (level, msg);
14
15 is_writing = false;
16 }
17 }
18
19- static void print_log (LogMessage log) {
20+ static void print_log (LogLevel level, string msg) {
21
22- set_color_for_level (log.Level);
23- stdout.printf ("[%s %s]", log.Level.to_string ().substring (27), get_time ());
24+ set_color_for_level (level);
25+ stdout.printf ("[%s %s]", level.to_string ().substring (27), get_time ());
26
27 reset_color ();
28- stdout.printf (" %s\n", log.Message);
29+ stdout.printf (" %s\n", msg);
30 }
31
32 static void set_color_for_level (LogLevel level) {

Subscribers

People subscribed via source and target branches