summaryrefslogtreecommitdiff
path: root/src/login/logind-button.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-01-27 21:14:14 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-01-27 23:47:18 -0500
commitc485437f50450c0087bae3df4aed462e4a86ee83 (patch)
treeca73d4e67303b53d8caa100ff8a17eca1e0c1849 /src/login/logind-button.c
parent28dcf77ffe346b2385dbb77f533bab2fa6bfb211 (diff)
logind: add MESSAGE_IDs to interesting events
Diffstat (limited to 'src/login/logind-button.c')
-rw-r--r--src/login/logind-button.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/src/login/logind-button.c b/src/login/logind-button.c
index dbf3d3c446..cbb067aa55 100644
--- a/src/login/logind-button.c
+++ b/src/login/logind-button.c
@@ -33,6 +33,7 @@
#include "logind-button.h"
#include "special.h"
#include "dbus-common.h"
+#include "sd-messages.h"
Button* button_new(Manager *m, const char *name) {
Button *b;
@@ -188,7 +189,10 @@ int button_process(Button *b) {
case KEY_POWER:
case KEY_POWER2:
- log_info("Power key pressed.");
+ log_struct(LOG_INFO,
+ "MESSAGE=Power key pressed.",
+ MESSAGE_ID(SD_MESSAGE_POWER_KEY),
+ NULL);
return button_handle(b, INHIBIT_HANDLE_POWER_KEY, b->manager->handle_power_key, b->manager->power_key_ignore_inhibited, true);
/* The kernel is a bit confused here:
@@ -198,11 +202,17 @@ int button_process(Button *b) {
*/
case KEY_SLEEP:
- log_info("Suspend key pressed.");
+ log_struct(LOG_INFO,
+ "MESSAGE=Suspend key pressed.",
+ MESSAGE_ID(SD_MESSAGE_SUSPEND_KEY),
+ NULL);
return button_handle(b, INHIBIT_HANDLE_SUSPEND_KEY, b->manager->handle_suspend_key, b->manager->suspend_key_ignore_inhibited, true);
case KEY_SUSPEND:
- log_info("Hibernate key pressed.");
+ log_struct(LOG_INFO,
+ "MESSAGE=Hibernate key pressed.",
+ MESSAGE_ID(SD_MESSAGE_HIBERNATE_KEY),
+ NULL);
return button_handle(b, INHIBIT_HANDLE_HIBERNATE_KEY, b->manager->handle_hibernate_key, b->manager->hibernate_key_ignore_inhibited, true);
}
@@ -211,7 +221,10 @@ int button_process(Button *b) {
switch (ev.code) {
case SW_LID:
- log_info("Lid closed.");
+ log_struct(LOG_INFO,
+ "MESSAGE=Lid closed.",
+ MESSAGE_ID(SD_MESSAGE_LID_CLOSED),
+ NULL);
b->lid_close_queued = true;
return button_handle(b, INHIBIT_HANDLE_LID_SWITCH, b->manager->handle_lid_switch, b->manager->lid_switch_ignore_inhibited, true);
@@ -222,7 +235,10 @@ int button_process(Button *b) {
switch (ev.code) {
case SW_LID:
- log_info("Lid opened.");
+ log_struct(LOG_INFO,
+ "MESSAGE=Lid opened.",
+ MESSAGE_ID(SD_MESSAGE_LID_OPENED),
+ NULL);
b->lid_close_queued = false;
break;
}