Re: [master] logging: turn the loglevels into proper enum.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-#define DEBUGLVL 10
-#define INFO     20
-#define WARNING  30
-#define ERROR    40
-#define CRITICAL 50
+enum loglevel_t {
+    DEBUGLVL,
+    INFO,
+    WARNING,
+    ERROR,
+    CRITICAL
+};

I realize you were probably just following the (bad) example below, but
you should really do this as:

typedef enum {
...
} loglevel_t;

and then all those callers above can be "loglevel_t level" instead of
"enum loglevel_t level".  Also naming things _t without them being
typedef's is a sin.

  enum logger_t {
      MAIN_LOG = 1,
      PROGRAM_LOG = 2
  };

--
        Peter

Space, is big. Really big. You just won't believe how vastly hugely
mindbogglingly big it is. I mean you may think it's a long way down the
road to the chemist, but that's just peanuts to space.
		-- The Hitchhiker's Guide to the Galaxy

01234567890123456789012345678901234567890123456789012345678901234567890123456789

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux