diff --git a/doc/sdk/plugin-management/guide-to-the-logging-api.en.rst b/doc/sdk/plugin-management/guide-to-the-logging-api.en.rst index e38c4d5d404..8c24eb054de 100644 --- a/doc/sdk/plugin-management/guide-to-the-logging-api.en.rst +++ b/doc/sdk/plugin-management/guide-to-the-logging-api.en.rst @@ -67,7 +67,8 @@ The steps below show how the logging API is used in the .. code-block:: c - log = TSTextLogObjectCreate("blacklist", TS_LOG_MODE_ADD_TIMESTAMP, NULL, &error); + TSReturnCode error = TSTextLogObjectCreate("blacklist", + TS_LOG_MODE_ADD_TIMESTAMP, &log); The new log is named ``blacklist.log``. Each entry written to the log will have a timestamp. The ``NULL`` argument specifies that the new @@ -80,7 +81,7 @@ The steps below show how the logging API is used in the .. code-block:: c - if (!log) { + if (error != TS_SUCCESS) { printf("Blacklist plugin: error %d while creating log\n", error); } diff --git a/doc/sdk/sample-source-code.en.rst b/doc/sdk/sample-source-code.en.rst index bd84584a44d..454795fd276 100644 --- a/doc/sdk/sample-source-code.en.rst +++ b/doc/sdk/sample-source-code.en.rst @@ -267,7 +267,6 @@ This plugin illustrates: int i; TSCont contp; TSPluginRegistrationInfo info; - int error; info.plugin_name = "blacklist-1"; info.vendor_name = "DsCompany"; @@ -283,9 +282,9 @@ This plugin illustrates: } /* create an TSTextLogObject to log blacklisted requests to */ - log = TSTextLogObjectCreate("blacklist", TS_LOG_MODE_ADD_TIMESTAMP, - NULL, &error); - if (!log) { + TSReturnCode error = TSTextLogObjectCreate("blacklist", TS_LOG_MODE_ADD_TIMESTAMP, + &log); + if (error != TS_SUCCESS) { printf("Blacklist plugin: error %d while creating log\n", error); }