From bbf6784e26b5f94c87c9deedb75711948d937f46 Mon Sep 17 00:00:00 2001 From: jaybinks Date: Wed, 26 Mar 2008 12:03:20 +0000 Subject: added "-debug" flag at run time and "CONSOLE" Define in switches.inc also the default is to run with no debug info sent to the console git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@973 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/ULog.pas | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'Game/Code/Classes/ULog.pas') diff --git a/Game/Code/Classes/ULog.pas b/Game/Code/Classes/ULog.pas index c30bf676..4e976ab4 100644 --- a/Game/Code/Classes/ULog.pas +++ b/Game/Code/Classes/ULog.pas @@ -53,6 +53,7 @@ type end; procedure SafeWriteLn(const msg: string); {$IFDEF HasInline}inline;{$ENDIF} +procedure debugWriteln( aString : String ); var Log: TLog; @@ -66,8 +67,8 @@ uses SysUtils, DateUtils, //UFiles, - UMain, URecord, + UMain, UTime, //UIni, // JB - Seems to not be needed. {$IFDEF FPC} @@ -136,10 +137,20 @@ begin SDL_CondSignal(ConsoleCond); SDL_mutexV(ConsoleMutex); {$ELSE} - WriteLn(msg); + debugWriteln(msg); {$ENDIF} end; +procedure debugWriteln( aString : String ); +begin + {$IFDEF CONSOLE} + if FindCmdLineSwitch( cDebug ) then + writeln( 'DEBUG - '+aString ); + {$ENDIF} + +end; + + constructor TLog.Create; begin {$IFDEF FPC} -- cgit v1.2.3