OpenersNotesSection(Spacer1)Details

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 (RefLink[wstp.h, paclet:ref/file/wstp.h]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)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 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);
}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[WSLogStreamToFile(), paclet:ref/c/WSLogStreamToFile])  ▪  (NonWLLink[WSDisableLoggingStream(), paclet:ref/c/WSDisableLoggingStream])  ▪  (NonWLLink[WSEnableLoggingStream(), paclet:ref/c/WSEnableLoggingStream])  ▪  (NonWLLink[WSStopLoggingStream(), paclet:ref/c/WSStopLoggingStream])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[WSTP C API Developer Guide (Mac OS X), paclet:tutorial/WSTPDeveloperGuide-MacintoshOverview])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Unix and Linux), paclet:tutorial/WSTPDeveloperGuide-UnixOverview])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Windows), paclet:tutorial/WSTPDeveloperGuide-WindowsOverview])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Alphabetical Listing of WSTP C Functions, paclet:guide/AlphabeticalListingOfWSTPCFunctions])}, {▪(RefLinkPlain[WSTP C Language Functions, paclet:guide/WSTPCLanguageFunctions])}})}})