MCPcopy Create free account
hub / github.com/apache/mesos / logFile

Function logFile

src/tests/fetcher_cache_tests.cpp:228–239  ·  view source on GitHub ↗

Dumps the contents of a text file to cout, assuming there are only text files.

Source from the content-addressed store, hash-verified

226// Dumps the contents of a text file to cout, assuming
227// there are only text files.
228static void logFile(const Path& path, const string& filename)
229{
230 string filePath = path::join(path.string(), filename);
231 Try<string> text = os::read(filePath);
232 if (text.isSome()) {
233 cout << "Begin file contents of `" << filename << "`:" << endl;
234 cout << text.get() << endl;
235 cout << "End file" << endl;
236 } else {
237 cout << "File `" << filename << "` not readable: " << text.error() << endl;
238 }
239}
240
241
242// Dumps the contents of all files in the sandbox to cout, assuming

Callers 1

foreachFunction · 0.85

Calls 6

errorMethod · 0.65
joinFunction · 0.50
readFunction · 0.50
stringMethod · 0.45
isSomeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected