aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2018-11-04 15:39:50 +0100
committerTeddy Wing2018-11-04 15:39:50 +0100
commitdf68b90dbf43ffeb563fc5d6f1fa34bccdcdf8bb (patch)
tree12c032f675b640ba8bff3c5d3b33741a82b53e62
parent51509e3b212d6aeae8c946beb454e0ed74e048c7 (diff)
downloadDomeKey-df68b90dbf43ffeb563fc5d6f1fa34bccdcdf8bb.tar.bz2
Replace `NSLog`ged error messages with `teprintf`
Use our own custom error formatter. I think `NSLog` messages get sent to syslog in a release build. This allows us to format the error messages the way we want and ensure they get printed to stderr.
-rw-r--r--DomeKey/Mappings.h1
-rw-r--r--DomeKey/Mappings.m3
-rw-r--r--DomeKey/main.m3
3 files changed, 4 insertions, 3 deletions
diff --git a/DomeKey/Mappings.h b/DomeKey/Mappings.h
index acd3546..ba0930d 100644
--- a/DomeKey/Mappings.h
+++ b/DomeKey/Mappings.h
@@ -10,6 +10,7 @@
#include <notify.h>
#import "dome_key_map.h"
+#import "log.h"
@interface Mappings : NSObject
diff --git a/DomeKey/Mappings.m b/DomeKey/Mappings.m
index 382dbba..072cd11 100644
--- a/DomeKey/Mappings.m
+++ b/DomeKey/Mappings.m
@@ -73,9 +73,8 @@ void reload_mappings(
{
uint32_t status = notify_post(NOTIFICATION_NAME_RELOAD);
if (status != 0) {
- // TODO: print to stderr
// Notification failed
- NSLog(@"Reload notification failed");
+ teprintf("Reload notification failed");
}
else {
// Run `dome_key_state_load_map_group()` to print any error messages
diff --git a/DomeKey/main.m b/DomeKey/main.m
index 7c2f1c7..a64b3d5 100644
--- a/DomeKey/main.m
+++ b/DomeKey/main.m
@@ -14,6 +14,7 @@
#import "LicenseHandler.h"
#import "Mappings.h"
#import "dome_key_map.h"
+#import "log.h"
static const char *VERSION = "1.0";
@@ -21,7 +22,7 @@ int main(int argc, const char * argv[]) {
Config *config = dome_key_config_get();
if (!config) {
- NSLog(@"Unable to get config");
+ teprintf("Unable to get config");
return EX_CONFIG;
}