summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2018-01-22 03:57:39 -0500
committerbill-auger <mr.j.spam.me@gmail.com>2018-02-13 13:29:34 -0500
commitd33f18f36a68acb876ec37cf53ad4b62ac093a86 (patch)
tree378aa3ad349a6f48c7e682c50e44cb49d57d1abf
parente3d497bc8743f82d014711867198a9f771cba6d4 (diff)
squashme logging
-rw-r--r--post_fsd_wiki.phantomjs19
1 files changed, 10 insertions, 9 deletions
diff --git a/post_fsd_wiki.phantomjs b/post_fsd_wiki.phantomjs
index 03ba50d..a6c3d4f 100644
--- a/post_fsd_wiki.phantomjs
+++ b/post_fsd_wiki.phantomjs
@@ -129,11 +129,10 @@ function VerifyLogin()
username != wiki_login.toLowerCase())
return "ERROR: login failed" ;
- console.info("signed in as: " + username) ; return '' ;
+ LOG("signed in as: " + username) ; return '' ;
} , USERNAME_LI_ID , WIKI_LOGIN , IsA , LOG)) ;
IsReady = true ;
-
}
function LoadWikiData()
@@ -203,7 +202,8 @@ if (DEBUG_VB) DUMPFILE() ;
if (Page.url.toLowerCase() != expected_url) { ForceQuit("edit post failed") ; return ; }
var err = EvalQuitOnErr(Page.evaluate(function(wiki_title_h1_id , wiki_text_div_id ,
- page_title , new_wiki_text )
+ page_title , new_wiki_text ,
+ IsA , DBG )
{
var wiki_title_h1 = document.getElementById(wiki_title_h1_id) ;
var wiki_text_div = document.getElementById(wiki_text_div_id) ;
@@ -334,7 +334,8 @@ function DBG(context)
{
function Dbg(dbg) { console.log('\033[00;34m' + dbg + '\033[00m') ; }
function DbgSubmitEditEvalIn(wiki_text_input , wiki_submit_button)
- { Dbg("SubmitEdit() wiki_text_input=" + wiki_text_input ) ;
+ {
+ Dbg("SubmitEdit() wiki_text_input=" + wiki_text_input ) ;
Dbg("SubmitEdit() wiki_text_input .nodeName" + wiki_text_input .nodeName) ;
Dbg("SubmitEdit() wiki_submit_button" + wiki_submit_button ) ;
Dbg("SubmitEdit() wiki_submit_button.nodeName" + wiki_submit_button.nodeName) ; }
@@ -345,7 +346,7 @@ function DBG(context)
Dbg("SubmitEdit() post_wiki_text=" + post_wiki_text ) ;
Dbg("SubmitEdit() (modified_wiki_text == existing_wiki_text)=" + (modified_wiki_text == existing_wiki_text)) ;
Dbg("SubmitEdit() wiki_text_regex.test(existing_wiki_text)=" + wiki_text_regex.test(existing_wiki_text) ) ; }
- function DbgSubmitEditOut(post_wiki_text) { if (DEBUG_VB) DBG("SubmitEdit() returned post_wiki_text=" + post_wiki_text) ; }
+ function DbgSubmitEditOut(post_wiki_text) { if (DEBUG_VB) Dbg("SubmitEdit() returned post_wiki_text=" + post_wiki_text) ; }
function DbgVerifyEdit(wiki_title_h1 , wiki_text_div , existing_wiki_title , page_title , existing_wiki_text , new_wiki_text , wiki_text_regex)
{ Dbg("VerifyEdit() wiki_title_h1=" + wiki_title_h1 + " wiki_title_h1.nodeName=" + wiki_title_h1.nodeName ) ;
Dbg("VerifyEdit() wiki_text_div=" + wiki_text_div + " wiki_text_div.nodeName=" + wiki_text_div.nodeName ) ;
@@ -355,11 +356,11 @@ function DBG(context)
Dbg("VerifyEdit() new_wiki_text=" + new_wiki_text ) ;
Dbg("VerifyEdit() (existing_wiki_title == page_title )=" + (existing_wiki_title == page_title) ) ;
Dbg("VerifyEdit() wiki_text_regex .test(existing_wiki_text)=" + wiki_text_regex .test(existing_wiki_text) ) ; }
- function DbgMainLoop() { if (DEBUG_VB) DBG('')("MainLoop() ShouldQuit=" + ShouldQuit + " IsReady=" + IsReady) ; }
- function DbgGetUrl(get_url) { DBG('')("GetUrl() " + get_url) ; }
+ function DbgMainLoop() { if (DEBUG_VB) Dbg("MainLoop() ShouldQuit=" + ShouldQuit + " IsReady=" + IsReady) ; }
+ function DbgGetUrl(get_url) { Dbg("GetUrl() " + get_url) ; }
- return (DEBUG) ? eval('Dbg' + context) : function(){} ;
-}
+ return eval('Dbg' + context) ;
+} if (!DEBUG) DBG = function(context) { return function(){} } ;
/* main entry */