After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 750795 - Add category label to log entries from important category
Add category label to log entries from important category
Status: RESOLVED FIXED
Product: gnome-logs
Classification: Other
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gnome-logs maintainer(s)
gnome-logs maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-06-11 14:49 UTC by Jonathan Kang
Modified: 2015-06-12 15:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for this bug (15.60 KB, patch)
2015-06-11 14:55 UTC, Jonathan Kang
needs-work Details | Review
patch updated (15.67 KB, patch)
2015-06-12 13:27 UTC, Jonathan Kang
committed Details | Review

Description Jonathan Kang 2015-06-11 14:49:51 UTC
Use a GtkLabel to show which category the log entries from important category belong to.
Comment 1 Jonathan Kang 2015-06-11 14:55:53 UTC
Created attachment 305077 [details] [review]
patch for this bug

Here is the patch.
Comment 2 David King 2015-06-11 22:45:56 UTC
Review of attachment 305077 [details] [review]:

The commit message looks a bit long, as do some of the code lines, so double-check that things are wrapped to 79 characters.

Other than the specific comments below, this looks good!

::: src/gl-journal.c
@@ +324,3 @@
+    if (error != NULL)
+    {
+        g_debug ("%s", error->message);

You should give a string before the error here, something like "Errowhile getting transport from journal: ".

@@ +332,3 @@
+    if (error != NULL)
+    {
+        g_debug ("%s", error->message);

Similar comment about the debug message as above.

@@ +594,3 @@
 }
 
+

Stray extra line.

@@ +606,3 @@
+gl_journal_entry_get_uid (GlJournalEntry *entry)
+{
+  g_return_val_if_fail (GL_IS_JOURNAL_ENTRY (entry), 0);

Does it make sense to also return -1 here?
Comment 3 Jonathan Kang 2015-06-12 07:17:00 UTC
"
@@ +606,3 @@
+gl_journal_entry_get_uid (GlJournalEntry *entry)
+{
+  g_return_val_if_fail (GL_IS_JOURNAL_ENTRY (entry), 0);

Does it make sense to also return -1 here?
"

Comment on this: -1 represents invalid uid. A integer value should be returned in this function, I think returning -1 makes sense if we check whether uid is valid or not when we need use uid.
Comment 4 David King 2015-06-12 07:36:00 UTC
(In reply to Jonathan Kang from comment #3)
> Comment on this: -1 represents invalid uid. A integer value should be
> returned in this function, I think returning -1 makes sense if we check
> whether uid is valid or not when we need use uid.

It mostly depends on whether you consider that calling this function with an invalid GlJournalEntry should give an invalid UID as a response (-1) or simply return with 0. 0 has the downside that some log messages have a UID of 0, so the response may be confused with a valid UID. -1 has the advantage that it represents an invalid UID, but the downside that it can also represent a failure to obtain the UID (although this is extremely unlikely).
Comment 5 Jonathan Kang 2015-06-12 13:08:41 UTC
(In reply to David King from comment #4)
> It mostly depends on whether you consider that calling this function with an
> invalid GlJournalEntry should give an invalid UID as a response (-1) or
> simply return with 0. 0 has the downside that some log messages have a UID
> of 0, so the response may be confused with a valid UID. -1 has the advantage
> that it represents an invalid UID, but the downside that it can also
> represent a failure to obtain the UID (although this is extremely unlikely).

So What about we use another minus integer to represent the invalid uids, like -2. Is't fine?
Comment 6 David King 2015-06-12 13:18:33 UTC
-1 should be fine for the moment.
Comment 7 Jonathan Kang 2015-06-12 13:27:30 UTC
Created attachment 305148 [details] [review]
patch updated
Comment 8 David King 2015-06-12 15:03:30 UTC
Review of attachment 305148 [details] [review]:

Pushed, with a few changes. You did not update the line wrapping in the commit message, and did not change the g_return_val_if_fail() call to return -1. I also added gl-eventviewrow.c to po/POTFILE.in.