MCPcopy Create free account
hub / github.com/MayaPosch/NymphCast / start_logger

Function start_logger

player/NymphCastPlayer/mainwindow.cpp:83–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81
82
83int start_logger(const char* app_name) {
84 tag = app_name;
85
86 /* make stdout line-buffered and stderr unbuffered */
87 setvbuf(stdout, 0, _IOLBF, 0);
88 setvbuf(stderr, 0, _IONBF, 0);
89
90 /* create the pipe and redirect stdout and stderr */
91 pipe(pfd);
92 dup2(pfd[1], 1);
93 dup2(pfd[1], 2);
94
95 /* spawn the logging thread */
96 if (pthread_create(&thr, 0, thread_func, 0) == -1) { return -1; }
97 pthread_detach(thr);
98 return 0;
99}
100
101#endif
102

Callers 1

MainWindowMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected