Class logger
[ Source
| Index
| Back to GNS
]
- public class logger
- extends Object
logger - makes sure that all important commands are logged.
Will cause all major commands (@connect, @login, @join, @joinnew,
-
d
- Stores current time and data.
-
data
- Sets up a PrintStream so we can just print the data without playing with
bytes.
-
debug
- Stores the current debug state.
-
file
- The File we are outputting to.
-
PATH
- path to data directory
-
logger(boolean, gnsd)
- Creates and instance of the logger class.
-
logger(boolean, gnsd, String)
- Creates and instance of the logger class.
-
debug()
- Allows any class with a instance of logger to determing if we are
in a debug state.
-
print(String)
- Prints the given message to the log.
-
setup(String)
- Opens a copy of the file and keeps it open.
PATH
String PATH
- path to data directory
d
Date d
- Stores current time and data. This is used to timestamp each even with
time_t (seconds since ephoc Jan 1, 1970, 12:00am).
file
FileOutputStream file
- The File we are outputting to.
data
PrintStream data
- Sets up a PrintStream so we can just print the data without playing with
bytes.
debug
boolean debug
- Stores the current debug state.
logger
public logger(boolean d,
gnsd s,
String name)
- Creates and instance of the logger class. All needed information is
passed into via this constructor.
- Parameters:
- d - are we in dubug mode?
- s - Instance of the server so we can get runtime info.
- name - name of the output file.
- See Also:
- setup
logger
public logger(boolean d,
gnsd s)
- Creates and instance of the logger class. All needed information is
passed into via this constructor. This is just like the other
constructor, but is assumes a file name of "access_log".
- Parameters:
- d - are we in dubug mode?
- s - Instance of the server so we can get runtime info.
- See Also:
- logger, setup
print
public void print(String msg)
- Prints the given message to the log. All data is timestamped via time_t.
If we are in a dubug mode, it will also echo to the screen.
- Parameters:
- msg - the message to print.
debug
public boolean debug()
- Allows any class with a instance of logger to determing if we are
in a debug state.
- Returns:
- true if we are debugging, false otherwise.
setup
private void setup(String name)
- Opens a copy of the file and keeps it open. This is just like any other
server. The file is open at start-up and is kept open until the server
is shut down.
- Parameters:
- name - file name to save the log in.
|