diff options
-rw-r--r-- | src/base/UConfig.pas | 10 | ||||
-rw-r--r-- | src/base/ULog.pas | 16 | ||||
-rw-r--r-- | src/ultrastardx.dpr | 12 |
3 files changed, 34 insertions, 4 deletions
diff --git a/src/base/UConfig.pas b/src/base/UConfig.pas index e48b5493..23ef0f3f 100644 --- a/src/base/UConfig.pas +++ b/src/base/UConfig.pas @@ -203,6 +203,16 @@ const (LIBSAMPLERATE_VERSION_RELEASE * VERSION_RELEASE); {$ENDIF} + {$IFNDEF lua_VERSION_MAJOR} + LUA_VERSION_MAJOR = '5'; + {$ENDIF} + {$IFNDEF lua_VERSION_MINOR} + LUA_VERSION_MINOR = '1'; + {$ENDIF} + {$IFNDEF lua_VERSION_RELEASE} + LUA_VERSION_RELEASE = '4'; + {$ENDIF} + function USDXVersionStr(): string; function USDXShortVersionStr(): string; diff --git a/src/base/ULog.pas b/src/base/ULog.pas index ea3cda4e..bde4d4e4 100644 --- a/src/base/ULog.pas +++ b/src/base/ULog.pas @@ -100,6 +100,8 @@ type procedure SetLogLevel(Level: integer); function GetLogLevel(): integer; + procedure SetLogFileLevel(Level: integer); + function GetLogFileLevel(): integer; procedure LogMsg(const Text: string; Level: integer); overload; procedure LogMsg(const Msg, Context: string; Level: integer); overload; {$IFDEF HasInline}inline;{$ENDIF} @@ -311,13 +313,21 @@ begin Result := LogLevel; end; +procedure TLog.SetLogFileLevel(Level: integer); +begin + LogFileLevel := Level; +end; + +function TLog.GetLogFileLevel(): integer; +begin + Result := LogFileLevel; +end; + procedure TLog.LogMsg(const Text: string; Level: integer); var LogMsg: string; begin - // TODO: what if (LogFileLevel < LogLevel)? Log to file without printing to - // console or do not log at all? At the moment nothing is logged. - if (Level <= LogLevel) then + if ((Level <= LogLevel) or (Level <= LogFileLevel)) then begin if (Level <= LOG_LEVEL_CRITICAL_MAX) then LogMsg := 'CRITICAL: ' + Text diff --git a/src/ultrastardx.dpr b/src/ultrastardx.dpr index 0523f818..2280d4c6 100644 --- a/src/ultrastardx.dpr +++ b/src/ultrastardx.dpr @@ -350,7 +350,17 @@ uses SysUtils; +const + sLineBreak = {$IFDEF LINUX} AnsiChar(#10) {$ENDIF} + {$IFDEF MSWINDOWS} AnsiString(#13#10) {$ENDIF}; begin - Main; + try + Main; + except + on E : Exception do + begin + ShowMessage('Exception class name = '+E.ClassName+sLineBreak+'Exception message = '+E.Message); + end; + end; end. |