MCPcopy Create free account
hub / github.com/apache/trafficserver / initializeLog

Function initializeLog

plugins/prefetch/fetch.cc:189–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187}
188
189bool
190initializeLog(TSTextLogObject &log, const PrefetchConfig &config)
191{
192 bool status = true;
193 if (!config.getLogName().empty()) {
194 if (nullptr == log) {
195 TSReturnCode error = TSTextLogObjectCreate(config.getLogName().c_str(), TS_LOG_MODE_ADD_TIMESTAMP, &log);
196 if (error != TS_SUCCESS) {
197 PrefetchError("failed to create log file");
198 status = false;
199 } else {
200 PrefetchDebug("initialized log file '%s'", config.getLogName().c_str());
201 }
202 } else {
203 PrefetchDebug("log file '%s' already initialized", config.getLogName().c_str());
204 }
205 } else {
206 PrefetchDebug("skip creating log file");
207 }
208 return status;
209}
210
211bool
212BgFetchState::init(const PrefetchConfig &config)

Callers 1

initMethod · 0.85

Calls 3

TSTextLogObjectCreateFunction · 0.85
emptyMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected