WSEnableLoggingStream()
This feature is not supported on the Wolfram Cloud.

int WSEnableLoggingStream ( WSLINK l )

enables logging for a WSTP connection specified by l previously disabled by a call to WSDisableLoggingStream().

DetailsDetails

  • If l had not previously activated logging with WSLogStreamToFile(), WSEnableLoggingStream() activates the logging mechanism.
  • WSDisableLoggingStream() and WSEnableLoggingStream() act as a toggle API mechanism for enabling and disabling logging on a link.
  • WSEnableLoggingStream() returns 0 on error, and a nonzero value on success.
  • WSEnableLoggingStream() is declared in the WSTP header file wstp.h.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

#include "wstp.h"

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

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

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

    WSActivate(link);

    /* ... */

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

    /* ... */

    apiResult = WSDisableLoggingStream(link);
    { /* error disabling logging to log file */ }

    /* ... */

    apiResult = WSEnableLoggingStream(link);
    { /* error re-enabling logging */ }

    /* ... */

    apiResult = WSStopLoggingStream(link);
    { /* error shutting down logging */ }

    WSClose(link);

    WSDeinitialize(env);
}