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

int WSStopLoggingStreamToFile(WSLINK l, const char *n)
disables logging of the stream activity for the WSTP connection specified by l to the file named by n.

DetailsDetails

  • WSStopLoggingStreamToFile() closes the file named by n.
  • WSStopLoggingStreamToFile() only disables logging to the file named by n for l. If l logs to more than one file in a given session, WSTP will continue to log events to those files.
  • WSStopLoggingStreamToFile() returns 0 on error and a nonzero value on success.
  • WSStopLoggingStreamToFile() 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)
{
    WSENV env;
    WSINK 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);
    if(link == (WSINK)0 || error != WSEOK)
    { /* Unable to create the WSTP link object */ }

    WSActivate(link);

    apiResult = WSLogStreamToFile(link, "/tmp/link.log");
    { /* Unable to log to link.log */ }

    apiResult = WSLogStreamToFile(link, "/path/to/another/link.log");
    { /* Unable to log to the other link.log */ }

    /* ... */

    apiResult = WSStopLoggingStreamToFile(link, "/tmp/link.log");
    { /* Error while disabling logging */ }

    /* ... */

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

    WSClose(link);
    WSDeinitialize(env);
}
Introduced in 2014
(10.0)