> First, is there a way to re-enable 'fopen()'?

Fopen is redefined in the preprocessor settings for the debug build.
It's fine to reenable it as long as you realize you won't get the
features of the steam filesystem (like searchpaths, support for gcf
files, automatic updates, etc).  For a log file you probably don't care.
This define is a guard to prevent mistakes while we were coding HL2.

Also, there is built in logging functionality in HL2.


The engine implments these:
static ConVar sv_logsdir( "sv_logsdir", "logs", FCVAR_ARCHIVE, "Folder
in the game directory where server logs will be stored." );
static ConVar sv_logfile( "sv_logfile", "1", FCVAR_ARCHIVE, "Log server
information in the log file." );
static ConVar sv_logecho( "sv_logecho", "1", FCVAR_ARCHIVE, "Echo log
information to the console." );
static ConVar sv_log_onefile( "sv_log_onefile", "0", FCVAR_ARCHIVE, "Log
server information to only one file" );

CON_COMMAND( log, "Enables logging to file, console, and udp < on | off
>." )


So you can just do:
Log on
at the console.  And then you can use the Log() command in dbg.h to
output logged data.


If you need something more than that you can write your own log or hook
ours in the debug library.

Jay


_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to