OutputStreamFormatter
public protocol OutputStreamFormatter
A formatter type for formating the output of a OutputStreamWriter
type.
OutputStreamFormatter have one purpose in life, to convert a Writer.LogEntry
into a formatted collection of bytes.
-
The encoding that will be used to encode the
message
attribute of theWriter.LogEntry
and the entire message if this is a String type output.Declaration
Swift
var encoding: String.Encoding { get }
-
Accepts traceLogs standard LogEntry and outputs an Array of bytes containing the formatted output.
See also
OutputStreamFormatterError
for error values that can be returned.Declaration
Swift
func bytes(from entry: Writer.LogEntry) -> Result<[UInt8], OutputStreamFormatterError>
Parameters
entry
A
Writer.LogEntry
to format and convert to a byte collection.Return Value
A
Result<[UInt8], OutputStreamFormatterError>
with a success value of the formatted byte collection and on error anOutputStreamFormatterError
value.