forked from cerc-io/laconic-console
More logging.
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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)
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user