| 187 | } |
| 188 | |
| 189 | bool |
| 190 | initializeLog(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 | |
| 211 | bool |
| 212 | BgFetchState::init(const PrefetchConfig &config) |
no test coverage detected