Commit Graph

2 Commits

Author SHA1 Message Date
Jonathan Bernard
21cdf6909c Added ParameterizedSocket and LoggerOutputStream classes.
ParameterizedSocket
-------------------

This is a wrapper around the basic java.net.Socket class that supports sending
and receiving messages with parameters. It exposes two methods:
`void sendMessage(String... message)` and `String[] receiveMessage()`. The
line-level format of the message is:

    START_TOKEN param [SEPARATOR param ...] END_TOKEN

Where `START_TOKEN` is the ASCII "Start heading" control code `0x01`,
`SEPARATOR` is the ASCII "record separator" code `0x1E`, and `END_TOKEN` is the
ASCII "end of transmission" code `0x03`.

LoggerOutputStream
------------------

An OutputStream implementation that flushes to an org.slf4j.Logger instance.
The log level is configurable. It is important to note that data written to
the stream accumulates in an internal buffer until `flush()` is called. At this
point the data is written out as one log message to the logger. It is expected
that one would wrap this stream in an auto-flushing PrintStream or PrintWriter
in actual use.
2012-11-21 13:33:15 -06:00
Jonathan Bernard
df8fcac2d2 Added slf4j, needed for SmartConfig to build. 2011-01-21 13:01:04 -06:00