MCPcopy Create free account
hub / github.com/VCVRack/Rack / init

Function init

src/logger.cpp:50–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48
49
50bool init() {
51 if (outputFile)
52 return true;
53
54 std::lock_guard<std::mutex> lock(mutex);
55 truncated = false;
56
57 // Don't open a file in development mode.
58 if (logPath.empty()) {
59 outputFile = stderr;
60 }
61 else {
62 truncated = isTruncated();
63
64 outputFile = std::fopen(logPath.c_str(), "w");
65 if (!outputFile) {
66 std::fprintf(stderr, "Could not open log at %s\n", logPath.c_str());
67 return false;
68 }
69 }
70
71 return true;
72}
73
74void destroy() {
75 std::lock_guard<std::mutex> lock(mutex);

Callers

nothing calls this directly

Calls 2

isTruncatedFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected