public class Log extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Log.Event
Represents a single received LCM message.
|
| Constructor and Description |
|---|
Log(String path,
String mode)
Opens a log file for reading or writing.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the log file and releases and system resources used by it.
|
void |
flush()
Flush any unwritten data to the underlying file descriptor.
|
String |
getPath()
Retrieves the path to the log file.
|
double |
getPositionFraction() |
Log.Event |
readNext()
Reads the next event in the log file
|
void |
seekPositionFraction(double frac)
Seek to a position in the log file, specified by a fraction.
|
void |
write(Log.Event e)
Writes an event to the log file.
|
void |
write(long utime,
String channel,
LCMEncodable msg)
A convenience method for write.
|
public Log(String path, String mode) throws IOException
path - the filename to openmode - Specifies the access mode, must be one of "r", "rw",
"rws", or "rwd". See RandomAccessFile for more detail.IOExceptionpublic String getPath()
public void flush()
throws IOException
IOExceptionpublic Log.Event readNext() throws IOException
EOFException - if the end of the file has been reached.IOExceptionpublic double getPositionFraction()
throws IOException
IOExceptionpublic void seekPositionFraction(double frac)
throws IOException
frac - a number in the range [0, 1)IOExceptionpublic void write(Log.Event e) throws IOException
IOExceptionpublic void write(long utime,
String channel,
LCMEncodable msg)
throws IOException
IOExceptionpublic void close()
throws IOException
IOException