More logging.

This commit is contained in:
2020-06-10 17:15:07 -05:00
parent 5965c53696
commit 0fb12ec30f
8 changed files with 61 additions and 15 deletions
+5 -3
View File
@@ -13,15 +13,17 @@ type JSONResult {
#
type Query {
app_swarm_log: JSONResult!
app_log: JSONResult!
app_status: JSONResult!
ipfs_log: JSONResult!
ipfs_status: JSONResult!
ipfs_swarm_log: JSONResult!
ipfs_swarm_status: JSONResult!
signal_log: JSONResult!
signal_status: JSONResult!
signal_swarm_log: JSONResult!
system_status: JSONResult!
wns_status: JSONResult!
wns_log: JSONResult!
wns_status: JSONResult!
}
schema {
+29 -5
View File
@@ -2,11 +2,7 @@
// Copyright 2020 DxOS.org
//
import moment from 'moment';
import pick from 'lodash.pick';
import os from 'os';
import si from 'systeminformation';
import { spawnSync } from "child_process";
import { spawnSync } from 'child_process';
class LogCache {
constructor(maxLines = 500) {
@@ -60,6 +56,34 @@ export const logResolvers = {
timestamp: new Date().toUTCString(),
json: JSON.stringify(logs)
};
},
signal_log: async () => {
const logs = await getLogs('signal');
return {
timestamp: new Date().toUTCString(),
json: JSON.stringify(logs)
};
},
ipfs_log: async () => {
const logs = await getLogs('ipfs');
return {
timestamp: new Date().toUTCString(),
json: JSON.stringify(logs)
};
},
ipfs_swarm_log: async () => {
const logs = await getLogs('ipfs');
return {
timestamp: new Date().toUTCString(),
json: JSON.stringify(logs)
};
},
app_log: async () => {
const logs = await getLogs('ipfs');
return {
timestamp: new Date().toUTCString(),
json: JSON.stringify(logs)
};
}
}
};