Package org.ghost4j
Class GhostscriptLoggerOutputStream
java.lang.Object
java.io.OutputStream
org.ghost4j.GhostscriptLoggerOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
Class used to wrap Ghostscript interpreter log messages in Slf4j messages.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ByteArrayOutputStreamByteArrayOutputStream used to store outputed messages being written.private org.slf4j.event.LevelLog level used when outputing messages to the logger.private static final intLine termination for a log message.private org.slf4j.LoggerLogger used to log messages.private static final StringLogger name. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidwrite(int b) Write method that stores data to write in the ByteArrayOutputStream and sends messages to the logger when a line ends.Methods inherited from class java.io.OutputStream
close, flush, nullOutputStream, write, write
-
Field Details
-
LOGGER_NAME
Logger name. -
LINE_END
private static final int LINE_ENDLine termination for a log message.- See Also:
-
baos
ByteArrayOutputStream used to store outputed messages being written. -
logger
private org.slf4j.Logger loggerLogger used to log messages. -
level
private org.slf4j.event.Level levelLog level used when outputing messages to the logger.
-
-
Constructor Details
-
GhostscriptLoggerOutputStream
public GhostscriptLoggerOutputStream(org.slf4j.event.Level level) Constructor.- Parameters:
level- Defines the log level of outputed messages.
-
-
Method Details
-
write
Write method that stores data to write in the ByteArrayOutputStream and sends messages to the logger when a line ends.- Specified by:
writein classOutputStream- Parameters:
b- Byte to write- Throws:
IOException
-