1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-08 05:57:02 +09:00

CU-g91gec: Debug in JSON flag

This commit is contained in:
Andrew Simachev 2021-03-26 09:05:55 +03:00
parent ecabec0f84
commit 12ddf06254
2 changed files with 16 additions and 4 deletions

View file

@ -457,7 +457,15 @@ function menuInit () {
if (config.allowDebug) {
config.debug = config.debug || {};
const flags = { ui: 'Interface', ho: 'Hidden objects', mw: 'Middleware', th: 'Threads', an: 'Analytics', dm: 'Dark Mode' };
const flags = {
ui: 'Interface',
ho: 'Hidden objects',
mw: 'Middleware',
th: 'Threads',
an: 'Analytics',
dm: 'Dark Mode',
js: 'JSON',
};
const flagMenu = [];
for (let i in flags) {

View file

@ -130,7 +130,8 @@ class Dispatcher {
};
if (data && data.toObject) {
console.log(Util.objectClear(data.toObject()));
const d = Util.objectClear(data.toObject());
console.log(config.debug.js ? JSON.stringify(d, null, 3) : d);
};
};
@ -691,10 +692,12 @@ class Dispatcher {
let t0 = performance.now();
let t1 = 0;
let t2 = 0;
let d = null;
if (debug) {
console.log(`%cRequest.${type}`, 'font-weight: bold; color: blue;');
console.log(Util.objectClear(data.toObject()));
d = Util.objectClear(data.toObject());
console.log(config.debug.js ? JSON.stringify(d, null, 3) : d);
};
try {
@ -730,7 +733,8 @@ class Dispatcher {
if (debug) {
console.log(`%cCallback.${type}`, 'font-weight: bold; color: green;');
console.log(Util.objectClear(response.toObject()));
d = Util.objectClear(response.toObject());
console.log(config.debug.js ? JSON.stringify(d, null, 3) : d);
};
if (message.event) {