WSDisableLoggingStream (C 函数)

int WSDisableLoggingStream( WSLINK l )

禁用由 l 指定的 WSTP 连接的流内容登录.

更多信息

  • WSDisableLoggingStream()WSEnableLoggingStream() 作为 API 机制的切换开关,启用和禁用登录一个链接.
  • WSDisableLoggingStream() 出错时,返回 0,成功时返回非零值.
  • WSTP 的标头文件 wstp.h 已对 WSDisableLoggingStream() 作出声明.

范例

基本范例  (1)

#include "wstp.h"

int main(int argc, char **argv)
{
    WSENV env;
    WSLINK link;
    int error;
    int apiResult;

    env = WSInitialize((WSEnvironmentParameter)0);
    if(env == (WSENV)0)
    { /* Unable to create WSTP environment object */ }

    link = WSOpenArgcArgv(env, argc, argv, &error)l;
    if(link == (WSLINK)0 || error != WSEOK)
    { /* Unable to create link object */ }

    WSActivate(link);

    /* ... */

    apiResult = WSLogStreamToFile(link, "/path/to/logFile.log");
    if(! apiResult)
    { /* unable to log to logFile.log */ }

    /* ... */

    apiResult = WSDisableLoggingStream(link);
    if(! apiResult)
    { /* error while stopping logging to logFile.log */ }

    /* ... */

    apiResult = WSStopLoggingStream(link);
    { /* error while turning off logging */ }

    WSClose(link);

    WSDeinitialize(env);
}