Lua_FunctionsLog.pas 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //******************************************************************************
  2. //*** LUA SCRIPT FUNCTIONS ***
  3. //*** ***
  4. //*** (c) Massimo Magnano 2005 ***
  5. //*** ***
  6. //*** ***
  7. //******************************************************************************
  8. // File : Lua_FunctionsLog.pas
  9. //
  10. // Description : Do Log of Functions called inside a script.
  11. //
  12. //******************************************************************************
  13. unit Lua_FunctionsLog;
  14. interface
  15. type
  16. Tfunction_LuaLog = procedure (FuncLog :PChar); stdcall;
  17. Var
  18. OnLuaLog :Tfunction_LuaLog =Nil;
  19. procedure DoFunctionLog(FuncName :String;
  20. Param1 :String=''; Param2 :String='';
  21. Param3 :String=''; Param4 :String='');
  22. implementation
  23. procedure DoFunctionLog(FuncName :String;
  24. Param1 :String=''; Param2 :String='';
  25. Param3 :String=''; Param4 :String='');
  26. Var
  27. xLog :String;
  28. begin
  29. if Assigned(OnLuaLog)
  30. then begin
  31. xLog := FuncName+'(';
  32. if (Param1<>'')
  33. then xLog :=xLog+Param1;
  34. if (Param2<>'')
  35. then xLog :=xLog+', '+Param2;
  36. if (Param3<>'')
  37. then xLog :=xLog+', '+Param3;
  38. if (Param4<>'')
  39. then xLog :=xLog+', '+Param4;
  40. xLog :=xLog+')';
  41. OnLuaLog(PChar(xLog));
  42. end;
  43. end;
  44. end.