diff --git a/Source/Simba.lpr b/Source/Simba.lpr index 4f6163e6d..440c40a22 100644 --- a/Source/Simba.lpr +++ b/Source/Simba.lpr @@ -10,7 +10,7 @@ uses simba.init, - Classes, SysUtils, Interfaces, Forms, LazLogger, + Classes, SysUtils, Interfaces, Forms, simba.mufasatypes, simba.main, simba.aboutform, simba.debugimageform, simba.imagetostringform, simba.functionlistform, simba.scripttabsform, simba.outputform, @@ -25,8 +25,6 @@ SetHeapTraceOutput(IntToStr(GetProcessID()) + '.trc'); {$ENDIF} - DebugLogger.CloseLogFileBetweenWrites := True; - Application.CaptureExceptions := False; Application.Initialize(); diff --git a/Source/codetools/mpaslex.pas b/Source/codetools/mpaslex.pas index 73571a430..338fda247 100644 --- a/Source/codetools/mpaslex.pas +++ b/Source/codetools/mpaslex.pas @@ -37,7 +37,7 @@ interface uses SysUtils, Classes, - simba.list, simba.stack, + simba.mufasatypes, simba.list, simba.stack, mPasLexTypes; type @@ -248,9 +248,6 @@ TmwPasLex = class(TmwBasePasLex) implementation -uses - lazloggerbase; - procedure TmwBasePasLex.ClearDefines; var Frame: PDefineRec; diff --git a/Source/codetools/msimplepaspar.pas b/Source/codetools/msimplepaspar.pas index 56b8ee285..3251d7afd 100644 --- a/Source/codetools/msimplepaspar.pas +++ b/Source/codetools/msimplepaspar.pas @@ -37,7 +37,8 @@ interface uses SysUtils, Classes, - mPasLexTypes, mPasLex; + mPasLexTypes, mPasLex, + simba.mufasatypes; const ClassMethodDirectiveEnum = [ @@ -366,11 +367,10 @@ TmwSimplePasPar = class(TObject) implementation +{$IFDEF PARSER_BENCHMARK} uses - LazLoggerBase - {$IFDEF PARSER_BENCHMARK}, - simba.datetime - {$ENDIF}; + simba.datetime; +{$ENDIF} procedure TmwSimplePasPar.ForwardDeclaration; begin diff --git a/Source/script/imports/simba/simba.import_internal.pas b/Source/script/imports/simba/simba.import_internal.pas index cf60d0f09..c5c555c2d 100644 --- a/Source/script/imports/simba/simba.import_internal.pas +++ b/Source/script/imports/simba/simba.import_internal.pas @@ -13,19 +13,19 @@ procedure ImportInternal(Compiler: TSimbaScript_Compiler); implementation uses - lazloggerbase, lptypes, + lptypes, simba.tpa, simba.algo_sort, simba.algo_unique, simba.algo_difference, simba.algo_intersection, simba.algo_symmetricDifference, simba.script, simba.bitmap, simba.process; procedure _LapeWrite(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV begin - DbgOut(PString(Params^[0])^); + Debug(PString(Params^[0])^); end; procedure _LapeWriteLn(const Params: PParamArray); LAPE_WRAPPER_CALLING_CONV begin - DebugLn(); + DebugLn(''); end; // Sort diff --git a/Source/simba.dockinghelpers.pas b/Source/simba.dockinghelpers.pas index 92c76c22d..6454f9a04 100644 --- a/Source/simba.dockinghelpers.pas +++ b/Source/simba.dockinghelpers.pas @@ -72,7 +72,7 @@ TAnchorDockMasterHelper = class helper for TAnchorDockMaster implementation uses - anchordockstorage, xmlpropstorage, lazloggerbase, lazconfigstorage, + anchordockstorage, xmlpropstorage, lazconfigstorage, simba.theme, simba.fonthelpers; procedure TSimbaAnchorDockHeader.ParentFontChanged; diff --git a/Source/simba.mufasatypes.pas b/Source/simba.mufasatypes.pas index 614708a77..2a9271da8 100644 --- a/Source/simba.mufasatypes.pas +++ b/Source/simba.mufasatypes.pas @@ -370,8 +370,9 @@ TComplex = record {$POP} var - DoSimbaDebugLn: procedure(const S: String) of object; + DoSimbaDebugLn: procedure(const S: String) of object = nil; +procedure Debug(const Msg: String); procedure DebugLn(const Msg: String); overload; procedure DebugLn(const Msg: String; Args: array of const); overload; @@ -415,7 +416,7 @@ procedure AssertMainThread(const Method: String); implementation uses - math, forms, lazloggerbase, uregexpr, strutils, jsonparser, jsonscanner, + math, forms, uregexpr, strutils, jsonparser, jsonscanner, simba.math, simba.overallocatearray, simba.geometry, simba.algo_sort, simba.tpa, simba.random; @@ -453,14 +454,27 @@ implementation {$UNDEF BODY} +procedure Debug(const Msg: String); +begin + {$I-} + Write(Msg); + {$I+} +end; + procedure DebugLn(const Msg: String); begin - DebugLogger.DebugLn(Msg); + {$I-} + WriteLn(Msg); + Flush(Output); + {$I+} end; procedure DebugLn(const Msg: String; Args: array of const); begin - DebugLogger.DebugLn(Msg, Args); + {$I-} + WriteLn(Format(Msg, Args)); + Flush(Output); + {$I+} end; procedure SimbaException(Message: String; Args: array of const); @@ -535,12 +549,15 @@ function FlagsFromString(var Str: String): EDebugLnFlags; procedure SimbaDebugLn(const Flags: EDebugLnFlags; const Msg: String); begin - DoSimbaDebugLn(FlagsToString(Flags) + Msg); + if Assigned(DoSimbaDebugLn) then + DoSimbaDebugLn(FlagsToString(Flags) + Msg) + else + DebugLn(FlagsToString(Flags) + Msg); end; procedure SimbaDebugLn(const Flags: EDebugLnFlags; const Msg: TStringArray); begin - DoSimbaDebugLn(FlagsToString(Flags) + LineEnding.Join(Msg)); + SimbaDebugLn(Flags, LineEnding.Join(Msg)); end; function Min(const A, B: Integer): Integer; @@ -650,8 +667,5 @@ function IfThen(const Val: Boolean; const IfTrue, IfFalse: String): String; Result := IfFalse; end; -initialization - DoSimbaDebugLn := @DebugLogger.DebugLn; - end. diff --git a/Source/simba.nativeinterface_linux.pas b/Source/simba.nativeinterface_linux.pas index 08a115c51..c84067779 100644 --- a/Source/simba.nativeinterface_linux.pas +++ b/Source/simba.nativeinterface_linux.pas @@ -75,7 +75,7 @@ TSimbaNativeInterface_Linux = class(TSimbaNativeInterface) implementation uses - x, xatom, keysym, baseunix, unix, linux, lcltype, lazloggerbase, ctypes, + x, xatom, keysym, baseunix, unix, linux, lcltype, ctypes, simba.process, simba.xlib, simba.windowhandle; const diff --git a/Source/simba.xlib.pas b/Source/simba.xlib.pas index 8155ed10d..821dc76c3 100644 --- a/Source/simba.xlib.pas +++ b/Source/simba.xlib.pas @@ -255,7 +255,8 @@ TSimbaXLib = record implementation uses - dl, lazloggerbase; + dl, + simba.mufasatypes; function dlmopen(ID: SizeInt; Path: PChar; Flags: Integer): Pointer; cdecl; external;