#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)l;
if(link == (WSLINK)0 || error != WSEOK)
{ /* 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);
}