Skip to content

Instantly share code, notes, and snippets.

@alyx
Created February 17, 2013 05:36
Show Gist options
  • Save alyx/4970337 to your computer and use it in GitHub Desktop.
Save alyx/4970337 to your computer and use it in GitHub Desktop.
From 62cc22747c26d8d94d1dcc5e8528dc39cc8da078 Mon Sep 17 00:00:00 2001
From: Alyx Wolcott <[email protected]>
Date: Sat, 16 Feb 2013 22:35:41 +0000
Subject: [PATCH] Changed the TYPE_ defines to an enum
---
ext/csyndi/logger.c | 2 +-
include/syndi/logger.h | 13 ++++++++-----
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/ext/csyndi/logger.c b/ext/csyndi/logger.c
index b8a8681..86b11d2 100644
--- a/ext/csyndi/logger.c
+++ b/ext/csyndi/logger.c
@@ -12,7 +12,7 @@ VALUE cLogger;
/* This will print a verbose message to STDOUT if the level of verbosity specified does
* not exceed the runtime verbosity.
*/
-static void log_out2scrn(int type, const char *message, int level)
+static void log_out2scrn(enum logger_event type, const char *message, int level)
{
char *real_type = ALLOCA_N(char, 12);
diff --git a/include/syndi/logger.h b/include/syndi/logger.h
index 0fcf565..13f7640 100644
--- a/include/syndi/logger.h
+++ b/include/syndi/logger.h
@@ -49,10 +49,13 @@ static void log_out2file(const char *type, const char *message);
static void log_dircheck();
/* symbolic constants for event types */
-#define TYPE_FATAL 0
-#define TYPE_ERROR 1
-#define TYPE_WARNING 2
-#define TYPE_INFO 3
-#define TYPE_DEBUG 4
+enum logger_event
+{
+ TYPE_DEBUG,
+ TYPE_INFO,
+ TYPE_WARNING,
+ TYPE_ERROR,
+ TYPE_FATAL
+};
#endif
--
1.7.12.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment