-class OutputSink(object):
-
- # Bits in the destination_bitv bitvector. Used to indicate the
- # output destination.
- STDOUT = 0x1
- STDERR = 0x2
- LOG_DEBUG = 0x4 # -\
- LOG_INFO = 0x8 # |
- LOG_WARNING = 0x10 # > Should provide logger to the c'tor.
- LOG_ERROR = 0x20 # |
- LOG_CRITICAL = 0x40 # _/
- FILENAME = 0x80 # Must provide a filename to the c'tor.
- HLOG = 0x100
-
- ALL_LOG_DESTINATIONS = (
- LOG_DEBUG | LOG_INFO | LOG_WARNING | LOG_ERROR | LOG_CRITICAL
- )
- ALL_OUTPUT_DESTINATIONS = 0x1FF
+class OutputMultiplexer(object):
+
+ class Destination(enum.IntEnum):
+ """Bits in the destination_bitv bitvector. Used to indicate the
+ output destination."""
+ STDOUT = 0x1
+ STDERR = 0x2
+ LOG_DEBUG = 0x4 # -\
+ LOG_INFO = 0x8 # |
+ LOG_WARNING = 0x10 # > Should provide logger to the c'tor.
+ LOG_ERROR = 0x20 # |
+ LOG_CRITICAL = 0x40 # _/
+ FILENAME = 0x80 # Must provide a filename to the c'tor.
+ FILEHANDLE = 0x100 # Must provide a handle to the c'tor.
+ HLOG = 0x200
+ ALL_LOG_DESTINATIONS = (
+ LOG_DEBUG | LOG_INFO | LOG_WARNING | LOG_ERROR | LOG_CRITICAL
+ )
+ ALL_OUTPUT_DESTINATIONS = 0x2FF