MLDisableLoggingStream (C 函数)

MLDisableLoggingStream 已经被 WSDisableLoggingStream 所取代.

int WLDisableLoggingStream( MLINK l )

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

更多信息

  • MLDisableLoggingStream()MLEnableLoggingStream() 作为 API 机制的切换开关,启用和禁用登录一个链接.
  • MLDisableLoggingStream() 出错时,返回 0,成功时返回非零值.
  • MLDisableLoggingStream() 在 MathLink 标头文件 mathlink.h 中被声明.

范例

基本范例  (1)

#include "mathlink.h"

int main(int argc, char **argv)
{
    MLENV env;
    MLINK link;
    int error;
    int apiResult;

    env = MLInitialize((MLEnvironmentParameter)0);
    if(env == (MLENV)0)
    { /* Unable to create MathLink environment object */ }

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

    MLActivate(link);

    /* ... */

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

    /* ... */

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

    /* ... */

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

    MLClose(link);

    MLDeinitialize(env);
}