mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-02-14 00:39:16 +00:00
unified log lines format
This commit is contained in:
parent
bc609373ac
commit
18d4100e82
@ -60,7 +60,7 @@ exports.init = function(app, callback) {
|
||||
.on('readable', function() {
|
||||
var data = stream.read();
|
||||
while (data) {
|
||||
client.emit('sync', 'data', data);
|
||||
client.emit('sync', 'data', {lines: [{text: data}]});
|
||||
data = stream.read();
|
||||
}
|
||||
})
|
||||
@ -109,6 +109,13 @@ exports.init = function(app, callback) {
|
||||
data += '\n';
|
||||
}
|
||||
|
||||
if (buildLogLineNumbersHash[build.id]) {
|
||||
buildLogLineNumbersHash[build.id]++;
|
||||
} else {
|
||||
buildLogLineNumbersHash[build.id] = 1;
|
||||
}
|
||||
var logLineNumber = buildLogLineNumbersHash[build.id];
|
||||
|
||||
var filePath = getBuildLogPath(build.id);
|
||||
|
||||
if (!writeStreamsHash[filePath]) {
|
||||
@ -126,17 +133,11 @@ exports.init = function(app, callback) {
|
||||
writeStreamsHash[filePath].write(data);
|
||||
|
||||
app.dataio.resource('build' + build.id).clientEmitSync(
|
||||
'data', data
|
||||
'data',
|
||||
{lines: [{number: logLineNumber, text: data}]}
|
||||
);
|
||||
|
||||
// write build logs to db
|
||||
if (buildLogLineNumbersHash[build.id]) {
|
||||
buildLogLineNumbersHash[build.id]++;
|
||||
} else {
|
||||
buildLogLineNumbersHash[build.id] = 1;
|
||||
}
|
||||
|
||||
var logLineNumber = buildLogLineNumbersHash[build.id];
|
||||
|
||||
db.logLines.put({
|
||||
buildId: build.id,
|
||||
|
@ -1,9 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
define([
|
||||
'underscore',
|
||||
'reflux', 'app/actions/build', 'app/connect'
|
||||
], function(_, Reflux, BuildActions, connect) {
|
||||
'underscore', 'reflux', 'app/actions/build', 'app/connect'
|
||||
], function(
|
||||
_, Reflux, BuildActions, connect
|
||||
) {
|
||||
var Store = Reflux.createStore({
|
||||
listenables: BuildActions,
|
||||
|
||||
@ -28,7 +29,7 @@ define([
|
||||
}
|
||||
|
||||
connect.resource(resourceName).subscribe('data', function(data) {
|
||||
output += data;
|
||||
output += _(data.lines).pluck('text').join('');
|
||||
|
||||
self.trigger({
|
||||
buildId: build.id,
|
||||
|
Loading…
Reference in New Issue
Block a user