Skip to content

Commit

Permalink
Disable logging in tests and example
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKlo committed Jan 16, 2025
1 parent 68c5cbc commit adfc1a9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ function ws_callback(wsi::Ptr{Cvoid}, reason::Cint, user::Ptr{Cvoid}, data::Ptr{
end

function ws_open(callback::Function, addr::String, port::Int, path::String)
lws_set_log_level(0, C_NULL)
callback_ptr = @cfunction(ws_callback, Cint, (Ptr{Cvoid}, Cint, Ptr{Cvoid}, Ptr{Cvoid}, Csize_t))
protocols = [
LwsProtocols(pointer("ws"), callback_ptr, 0, 0, 0, C_NULL, 0),
Expand Down
1 change: 1 addition & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ function ws_callback(wsi::Ptr{Cvoid}, reason::Cint, user::Ptr{Cvoid}, data::Ptr{
end

function ws_open(callback::Function, addr::String, port::Int, path::String)
lws_set_log_level(0, C_NULL)
callback_ptr = @cfunction(ws_callback, Cint, (Ptr{Cvoid}, Cint, Ptr{Cvoid}, Ptr{Cvoid}, Csize_t))
protocols = [
LwsProtocols(pointer("ws"), callback_ptr, 0, 0, 0, C_NULL, 0),
Expand Down
4 changes: 3 additions & 1 deletion docs/src/pages/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ function ws_callback(wsi::Ptr{Cvoid}, reason::Cint, user::Ptr{Cvoid}, data::Ptr{
end
```

Now we can define main `ws_open` function to open and initialize WebSocket connection. It has three main steps:
Now we can define main `ws_open` function to open and initialize WebSocket connection.
It is possible to set the log level using the `lws_set_log_level` function; in this example, logging is disabled. The `ws_open` function consists of three main steps:

- Setup WebSocket Protocol and Callback:

Expand All @@ -52,6 +53,7 @@ The function then enters an infinite loop, continuously calling `lws_service` to

```julia
function ws_open(callback::Function, addr::String, port::Int, path::String)
lws_set_log_level(0, C_NULL)
callback_ptr = @cfunction(ws_callback, Cint, (Ptr{Cvoid}, Cint, Ptr{Cvoid}, Ptr{Cvoid}, Csize_t))
protocols = [
LwsProtocols(pointer("ws"), callback_ptr, 0, 0, 0, C_NULL, 0),
Expand Down
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ function http_callback(wsi::Ptr{Cvoid}, reason::Cint, user::Ptr{Cvoid}, data::Pt
end

function http_get(cb::Function, addr::String, port::Int, path::String)
lws_set_log_level(0, C_NULL)
ctx = LwsContextCreationInfo()
callback_function = @cfunction(http_callback, Cint, (Ptr{Cvoid}, Cint, Ptr{Cvoid}, Ptr{UInt8}, Csize_t))
protocols = [
Expand Down

0 comments on commit adfc1a9

Please sign in to comment.