MLEnableLoggingStream (C Function)
MLEnableLoggingStream has been replaced by WSEnableLoggingStream.
enables logging for a MathLink connection specified by l previously disabled by a call to MLDisableLoggingStream().
Details
- If l had not previously activated logging with MLLogStreamToFile(), MLEnableLoggingStream() activates the logging mechanism.
- MLDisableLoggingStream() and MLEnableLoggingStream() act as a toggle API mechanism for enabling and disabling logging on a link.
- MLEnableLoggingStream() returns 0 on error, and a nonzero value on success.
- MLEnableLoggingStream() is declared in the MathLink header file mathlink.h.
Examples
Basic Examples (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);
}