APIdia Launch Partner
Top Description Fields Constructors Methods
java.rmi.server

public Class LogStream

extends PrintStream
Class Inheritance
Annotations
@Deprecated
Imports
java.io.*, java.util.*

Deprecated

no replacement

LogStream provides a mechanism for logging errors that are of possible interest to those monitoring a system.
Author
Ann Wollrath (lots of code stolen from Ken Arnold)
Since
1.1

Field Summary

Modifier and TypeField and Description
public static final int
BRIEF

log level constant (brief logging).

private StringBuffer
buffer

string buffer used for constructing log message prefixes

private ByteArrayOutputStream
bufOut

stream used for buffering lines

private static PrintStream
defaultStream

default output stream for new logs

private static Map<String, LogStream>
known

table mapping known log names to log stream objects

private OutputStream
logOut

stream where output of this log is sent to

private OutputStreamWriter
logWriter

string writer for writing message prefixes to log stream

private String
name

log name for this log

public static final int
SILENT

log level constant (no logging).

public static final int
VERBOSE

log level constant (verbose logging).

Constructor Summary

AccessConstructor and Description
private
LogStream(String
string identifying messages from this log
name
,
OutputStream out)
Deprecated no replacement

Create a new LogStream object.

Method Summary

Modifier and TypeMethod and Description
public static synchronized PrintStream

Returns:

default log stream
getDefaultStream
()
Deprecated no replacement

Return the current default stream for new logs.

public synchronized OutputStream

Returns:

output stream for this log
getOutputStream
()
Deprecated no replacement

Return the current stream to which output from this log is sent.

public static LogStream

Returns:

log associated with given name
log
(String
name identifying the desired LogStream
name
)
Deprecated no replacement

Return the LogStream identified by the given name.

public static int

Returns:

corresponding integer log level
parseLevel
(String
name of logging level (e.g., 'SILENT', 'BRIEF', 'VERBOSE')
s
)
Deprecated no replacement

Convert a string name of a logging level to its internal integer representation.

public static synchronized void
setDefaultStream(PrintStream
new default log stream
newDefault
)
Deprecated no replacement

Set the default stream for new logs.

public synchronized void
setOutputStream(OutputStream
new output stream for this log
out
)
Deprecated no replacement

Set the stream to which output from this log is sent.

public String

Returns:

log name
toString
()

Overrides java.lang.Object.toString.

Deprecated no replacement

Return log name as string representation.

public void
write(int b)

Overrides java.io.PrintStream.write.

Deprecated no replacement

Write a byte of data to the stream.

public void
write(byte[] b, int off, int len)

Overrides java.io.PrintStream.write.

Deprecated no replacement

Write a subarray of bytes.

Inherited from java.io.PrintStream:
appendappendappendcharsetcheckErrorclearErrorcloseflushformatformatprintprintprintprintprintprintprintprintprintprintfprintfprintlnprintlnprintlnprintlnprintlnprintlnprintlnprintlnprintlnprintlnsetErrorwritewriteBytes

Field Detail

BRIEFback to summary
public static final int BRIEF

log level constant (brief logging).

bufferback to summary
private StringBuffer buffer

string buffer used for constructing log message prefixes

bufOutback to summary
private ByteArrayOutputStream bufOut

stream used for buffering lines

defaultStreamback to summary
private static PrintStream defaultStream

default output stream for new logs

knownback to summary
private static Map<String, LogStream> known

table mapping known log names to log stream objects

logOutback to summary
private OutputStream logOut

stream where output of this log is sent to

logWriterback to summary
private OutputStreamWriter logWriter

string writer for writing message prefixes to log stream

nameback to summary
private String name

log name for this log

SILENTback to summary
public static final int SILENT

log level constant (no logging).

VERBOSEback to summary
public static final int VERBOSE

log level constant (verbose logging).

Constructor Detail

LogStreamback to summary
private LogStream(String name, OutputStream out)

Deprecated

no replacement

Create a new LogStream object. Since this only constructor is private, users must have a LogStream created through the "log" method.

Parameters
name:String

string identifying messages from this log

Annotations
@Deprecated
Since
1.1

Method Detail

getDefaultStreamback to summary
public static synchronized PrintStream getDefaultStream()

Deprecated

no replacement

Return the current default stream for new logs.

Returns:PrintStream

default log stream

Annotations
@Deprecated
Since
1.1
See Also
setDefaultStream
getOutputStreamback to summary
public synchronized OutputStream getOutputStream()

Deprecated

no replacement

Return the current stream to which output from this log is sent.

Returns:OutputStream

output stream for this log

Annotations
@Deprecated
Since
1.1
See Also
setOutputStream
logback to summary
public static LogStream log(String name)

Deprecated

no replacement

Return the LogStream identified by the given name. If a log corresponding to "name" does not exist, a log using the default stream is created.

Parameters
name:String

name identifying the desired LogStream

Returns:LogStream

log associated with given name

Annotations
@Deprecated
Since
1.1
parseLevelback to summary
public static int parseLevel(String s)

Deprecated

no replacement

Convert a string name of a logging level to its internal integer representation.

Parameters
s:String

name of logging level (e.g., 'SILENT', 'BRIEF', 'VERBOSE')

Returns:int

corresponding integer log level

Annotations
@Deprecated
Since
1.1
setDefaultStreamback to summary
public static synchronized void setDefaultStream(PrintStream newDefault)

Deprecated

no replacement

Set the default stream for new logs.

Parameters
newDefault:PrintStream

new default log stream

Annotations
@Deprecated
Since
1.1
See Also
getDefaultStream
setOutputStreamback to summary
public synchronized void setOutputStream(OutputStream out)

Deprecated

no replacement

Set the stream to which output from this log is sent.

Parameters
out:OutputStream

new output stream for this log

Annotations
@Deprecated
Since
1.1
See Also
getOutputStream
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Deprecated

no replacement

Return log name as string representation.

Returns:String

log name

Annotations
@Deprecated
Since
1.1
writeback to summary
public void write(int b)

Overrides java.io.PrintStream.write.

Deprecated

no replacement

Write a byte of data to the stream. If it is not a newline, then the byte is appended to the internal buffer. If it is a newline, then the currently buffered line is sent to the log's output stream, prefixed with the appropriate logging information.

Annotations
@Deprecated
Since
1.1
writeback to summary
public void write(byte[] b, int off, int len)

Overrides java.io.PrintStream.write.

Deprecated

no replacement

Write a subarray of bytes. Pass each through write byte method.

Annotations
@Deprecated
Since
1.1