diff --git a/docs/Logging.md b/docs/Logging.md index 46ea9f0..641eadd 100644 --- a/docs/Logging.md +++ b/docs/Logging.md @@ -86,23 +86,23 @@ Note that HomeSpan outputs the full content of the Web Log HTML, including whate Homespan provides a hook into the text used to generate the Web Log that you can extend to add your own data to the initial table as well as more generally add any custom HTML. -To access this text, set a Web Log callback using `homeSpan.setWebLogCallback(void (*func)(String &htmlText))` where +To access this text, set a Web Log callback using `homeSpan.setWebLogCallback(String (*func)())` where - * *func* is a function of type *void* that takes a single argument of type *String*, and - * *htmlText* will be set by HomeSpan to a String reference containing all the HTML text that the Web Log has already generated to produce the initial table. + * *func* is a function returning a *String* that takes no argument. + * The string returned will be appended by HomeSpan to the bottom of the initial table. -To add your own data to the table, simply extend the String *htmlText* by adding as many `
Click Here to Access HomeSpan Repo
"; + r+="
"; + return r; } ``` -To embed this custom HTML text in the Web Log, call `homeSpan.setWebLogCallback(extraWebData)` in your sketch. - -Note that *r* is being passed as a reference and already includes all the HTML text the Web Log has produced to set up the page and create the initial table. You should therefore *extend* this String using `+=`. Do not simple assign this variable to a new String with `=` or you will overwrite all the HTML already produced! +To embed this custom HTML text in the Web Log, call `homeSpan.setWebLogCallback(&extraWebData)` in your sketch. ---