WSStopLoggingStream (C Function)

int WSStopLoggingStream(WSLINK l)

disables all logging activity for the WSTP connection specified by l.

Details

  • WSStopLoggingStream() terminates all logging operations and closes all open log files.
  • WSStopLoggingStream() has the side effect of disabling any enabled link locks for l.
  • WSStopLoggingStream() returns 0 in the event of an error and a nonzero value on success.
  • WSStopLoggingStream() is declared in the WSTP header file wstp.h.

Examples

Basic Examples  (1)

#include "wstp.h"

int main(int argc, char **argv)
{
    WSENV env;
    WSLINK 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 == (WSLINK)0 || error != WSEOK)
    { /* Unable to create WSTP link object */ }

    WSActivate(link);

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

    /* ... */

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

    WSClose(link);
    WSDeinitialize(env);
}