From 65f7e32f94db6453578e81bbcbfbd1a5a970d27f Mon Sep 17 00:00:00 2001 From: Kevan Ahlquist Date: Wed, 18 Feb 2015 22:56:55 -0600 Subject: [PATCH] Strip headers from logs before display, fixes #94 --- .../containerLogs/containerLogsController.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/app/components/containerLogs/containerLogsController.js b/app/components/containerLogs/containerLogsController.js index 70eff4dfc..4241226e7 100644 --- a/app/components/containerLogs/containerLogsController.js +++ b/app/components/containerLogs/containerLogsController.js @@ -20,11 +20,20 @@ function($scope, $routeParams, $location, $anchorScroll, ContainerLogs, Containe function getLogs() { ContainerLogs.get($routeParams.id, {stdout: 1, stderr: 0, timestamps: $scope.showTimestamps}, function(data, status, headers, config) { - // Replace carriage returns twith newlines to clean up output - $scope.stdout = data.replace(/[\r]/g, '\n'); + // Replace carriage returns with newlines to clean up output + data = data.replace(/[\r]/g, '\n') + // Strip 8 byte header from each line of output + data = data.substring(8); + data = data.replace(/\n(.{8})/g, '\n'); + $scope.stdout = data; }); ContainerLogs.get($routeParams.id, {stdout: 0, stderr: 1, timestamps: $scope.showTimestamps}, function(data, status, headers, config) { - $scope.stderr = data.replace(/[\r]/g, '\n'); + // Replace carriage returns with newlines to clean up output + data = data.replace(/[\r]/g, '\n') + // Strip 8 byte header from each line of output + data = data.substring(8); + data = data.replace(/\n(.{8})/g, '\n'); + $scope.stderr = data; }); }