diff --git a/README.md b/README.md index 140bb37..8cda153 100644 --- a/README.md +++ b/README.md @@ -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), diff --git a/docs/src/index.md b/docs/src/index.md index 9fedd41..4a22193 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -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), diff --git a/docs/src/pages/manual.md b/docs/src/pages/manual.md index 1b96953..450f558 100644 --- a/docs/src/pages/manual.md +++ b/docs/src/pages/manual.md @@ -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: @@ -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), diff --git a/test/runtests.jl b/test/runtests.jl index 893987b..5501593 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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 = [