diff --git a/bricks/bricks.js b/bricks/bricks.js index 03c8726..ac9b146 100644 --- a/bricks/bricks.js +++ b/bricks/bricks.js @@ -445,6 +445,7 @@ bricks.App = class extends bricks.Layout { /* opts = { appname: + debug:false, true, 'server' login_url: "charsize: "language": diff --git a/bricks/utils.js b/bricks/utils.js index d9cdfa4..6c5a60f 100644 --- a/bricks/utils.js +++ b/bricks/utils.js @@ -13,10 +13,24 @@ bricks.is_empty = function(obj){ if (obj === null) return true; return JSON.stringify(obj) === '{}'; } +bricks.serverdebug = async function(message){ + console.log(arguments, 'er==============er'); + var jc = new bricks.HttpJson(); + await jc.post(url='/debug', {params:{ + message:message + }}); + return; +} bricks.debug = function(...args){ if (! bricks.bug){ return; } + if (bricks.bug == 'server'){ + var message = args.join(" "); + f = bricks.serverdebug.bind(null, message); + schedule_once(f, 0.1); + return; + } var callInfo; try { throw new Error();