MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / moveLogs

Method moveLogs

test/one/profiler/test/TestProcess.java:244–263  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

242 }
243
244 private void moveLogs() {
245 if (logDir == null) {
246 return;
247 }
248
249 try {
250 Files.createDirectories(Paths.get(logDir));
251
252 moveLog(tmpFiles.get(STDOUT), "stdout", true);
253 moveLog(tmpFiles.get(STDERR), "stderr", false);
254
255 for (String key : tmpFiles.keySet()) {
256 if (!key.equals(STDERR) && !key.equals(STDOUT)) {
257 moveLog(tmpFiles.get(key), key.substring(1), true);
258 }
259 }
260 } catch (IOException e) {
261 log.log(Level.WARNING, "Failed to move logs", e);
262 }
263 }
264
265 private boolean isRoot() {
266 try (Stream<String> lines = Files.lines(Paths.get("/proc/self/status"))) {

Callers 1

closeMethod · 0.95

Calls 4

moveLogMethod · 0.95
logMethod · 0.80
getMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected