From e4f5468410c36c7040fc72e67cf9a495d92b86ac Mon Sep 17 00:00:00 2001 From: Tony Tiger Date: Tue, 30 Dec 2014 15:33:32 +0000 Subject: [PATCH] Correcting documentation's use of TSTextLogObjectCreate --- doc/sdk/plugin-management/guide-to-the-logging-api.en.rst | 5 +++-- doc/sdk/sample-source-code.en.rst | 7 +++---- 2 files changed, 6 insertions(+), 6 deletions(-) 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); }