NetDragons Free Stock Charts | Travel Posters
Games | Free Web Hosting | DVD | Books | Shop | Posters
Google
Name
Password
Save Password?



[-]NetDragons.com
[-]Games
 | [-]24 Hour Games
 |  | [+]Nelzan
 |  | [+]Space Frag I
 |  | [-]GNet Server
 |  |  | [+]Commands
 |  |  | [+]Forum
 |  |  | [+]Protocol
 |  |  | [-]Source
 |  | [+]About
 |  | [+]Forum
 |  | [+]License
 | [+]Cards of Tridala
 | [+]Flash Games
 | [+]Vagabond's Quest+
 | [+]Vagabond's Quest v.2
 | [+]Projects
[+]NetDragons.com Live!
[+]Reward Center
[+]Software Center
[+]Company Information
[+]Personal Services
[+]Member Directory
[+]Free E-mail
[+]Buy Cool Stuff
[+]Posters
[+]Your Privacy

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,


Variable Index

 o d
Stores current time and data.
 o data
Sets up a PrintStream so we can just print the data without playing with bytes.
 o debug
Stores the current debug state.
 o file
The File we are outputting to.
 o PATH
path to data directory

Constructor Index

 o logger(boolean, gnsd)
Creates and instance of the logger class.
 o logger(boolean, gnsd, String)
Creates and instance of the logger class.

Method Index

 o debug()
Allows any class with a instance of logger to determing if we are in a debug state.
 o print(String)
Prints the given message to the log.
 o setup(String)
Opens a copy of the file and keeps it open.

Variables

 o PATH
 String PATH
path to data directory

 o 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).

 o file
 FileOutputStream file
The File we are outputting to.

 o data
 PrintStream data
Sets up a PrintStream so we can just print the data without playing with bytes.

 o debug
 boolean debug
Stores the current debug state.

Constructors

 o 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
 o 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

Methods

 o 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.
 o 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.
 o 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.
ND: VQ+, Mail, Shop, Free Web Hosting Free Stock Screener

Gustav Klimt Posters
Copyrighted �, 2000, 2001 by NetDragons.com
Last Updated Sunday, March 21, 1999 - 23:50 EST