MLEnableLoggingStream (C 函数)
MLEnableLoggingStream 已经被 WSEnableLoggingStream 所取代.
更多信息
- 如果 l 之前没有用 MLLogStreamToFile() 登录激活,MLEnableLoggingStream() 会激活登录机制.
- MLDisableLoggingStream() 与 MLEnableLoggingStream() 作为一个 API 机制切换开关启用和禁用登录一个链接.
- MLEnableLoggingStream() 如果出错,则返回0,成功则返回一个非零值.
- MLEnableLoggingStream() 在 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");
{ /* unable to log to logFile.log */ }
/* ... */
apiResult = MLDisableLoggingStream(link);
{ /* error disabling logging to log file */ }
/* ... */
apiResult = MLEnableLoggingStream(link);
{ /* error re-enabling logging */ }
/* ... */
apiResult = MLStopLoggingStream(link);
{ /* error shutting down logging */ }
MLClose(link);
MLDeinitialize(env);
}