* Some minor improvements

This commit is contained in:
Michaël Van Canneyt 2024-09-18 17:49:41 +02:00
parent 5ac4fd0b13
commit b18e381049
4 changed files with 9 additions and 9 deletions

View File

@ -6,7 +6,7 @@ uses
{$IFDEF UNIX} {$IFDEF UNIX}
cthreads, cthreads,
{$ENDIF} {$ENDIF}
SysUtils, Classes, wasm.timer.shared, wasm.timer.api, wasm.logger.api, wasm.timer.objects, wasm.http.api; SysUtils, Classes, wasm.timer.shared, wasm.timer.api, wasm.logger.api, wasm.timer.objects;
Type Type

View File

@ -85,7 +85,7 @@ function __wasmhttp_response_callback(aRequestID : TWasmHTTPRequestID; aUserData
procedure __wasmhttp_log(level : TWasmHTTPLogLevel; const Msg : String); procedure __wasmhttp_log(level : TWasmHTTPLogLevel; const Msg : String);
procedure __wasmhttp_log(level : TWasmHTTPLogLevel; const Fmt : String; Args : Array of const); procedure __wasmhttp_log(level : TWasmHTTPLogLevel; const Fmt : String; const Args : Array of const);
var var
OnWasmHTTPResponse : TWasmHTTPResponseEvent; OnWasmHTTPResponse : TWasmHTTPResponseEvent;
@ -108,7 +108,7 @@ begin
__wasm_log(level,'HTTP',Msg); __wasm_log(level,'HTTP',Msg);
end; end;
procedure __wasmhttp_log(level : TWasmHTTPLogLevel; const Fmt : String; Args : Array of const); procedure __wasmhttp_log(level : TWasmHTTPLogLevel; const Fmt : String; const Args : Array of const);
begin begin
if not EnableWasmHTTPLog then if not EnableWasmHTTPLog then

View File

@ -33,14 +33,14 @@ Type
TWasmLogHook = procedure (Level : TWasmLogLevel; const Msg : string) of object; TWasmLogHook = procedure (Level : TWasmLogLevel; const Msg : string) of object;
Const Const
AllLogLevels = [Low(TWasmLogLevel)..High(TWasmLogLevel)]; AllWasmLogLevels = [Low(TWasmLogLevel)..High(TWasmLogLevel)];
var var
OnWasmLog : TWasmLogHook; OnWasmLog : TWasmLogHook;
WasmLogLevels : TWasmLogLevels = AllLogLevels; WasmLogLevels : TWasmLogLevels = AllWasmLogLevels;
procedure __wasm_log(level : TWasmLogLevel; const Module, Msg : String); procedure __wasm_log(level : TWasmLogLevel; const Module, Msg : String);
procedure __wasm_log(level : TWasmLogLevel; const Module, Fmt : String; Args : Array of const); procedure __wasm_log(level : TWasmLogLevel; const Module, Fmt : String; const Args : Array of const);
implementation implementation
@ -54,7 +54,7 @@ begin
OnWasmLog(level,'['+Module+'] '+Msg); OnWasmLog(level,'['+Module+'] '+Msg);
end; end;
procedure __wasm_log(level : TWasmLogLevel; const Module, Fmt : String; Args : Array of const); procedure __wasm_log(level : TWasmLogLevel; const Module, Fmt : String; const Args : Array of const);
begin begin
if not (level in WasmLogLevels) then if not (level in WasmLogLevels) then

View File

@ -81,7 +81,7 @@ Function __wasm_websocket_on_close (aWebsocketID : TWasmWebSocketID; aUserData :
procedure __wasmwebsocket_log(level : TWasmLogLevel; const Msg : String); procedure __wasmwebsocket_log(level : TWasmLogLevel; const Msg : String);
procedure __wasmwebsocket_log(level : TWasmLogLevel; const Fmt : String; Args : Array of const); procedure __wasmwebsocket_log(level : TWasmLogLevel; const Fmt : String; const Args : Array of const);
var var
WebSocketLogEnabled : Boolean; WebSocketLogEnabled : Boolean;
@ -100,7 +100,7 @@ begin
__wasm_log(level,'websocket',msg); __wasm_log(level,'websocket',msg);
end; end;
procedure __wasmwebsocket_log(level : TWasmWebSocketLogLevel; const Fmt : String; Args : Array of const); procedure __wasmwebsocket_log(level : TWasmWebSocketLogLevel; const Fmt : String; const Args : Array of const);
begin begin
if not WebSocketLogEnabled then if not WebSocketLogEnabled then