diff --git a/src/import-export/qif-import/dialog-account-picker.c b/src/import-export/qif-import/dialog-account-picker.c index f6fbacf41e..8ae0df0610 100644 --- a/src/import-export/qif-import/dialog-account-picker.c +++ b/src/import-export/qif-import/dialog-account-picker.c @@ -69,7 +69,7 @@ acct_tree_add_accts(SCM accts, current = SCM_CAR(accts); if(SCM_NULLP(current)) { - printf(" ** BUG in acct tree .. grib fix me! (everybody else ignore)\n"); + g_critical("QIF import: BUG DETECTED in acct_tree_add_accts!"); accts = SCM_CDR(accts); continue; } diff --git a/src/import-export/qif-import/druid-qif-import.c b/src/import-export/qif-import/druid-qif-import.c index 912ee7c9ac..835ab605ed 100644 --- a/src/import-export/qif-import/druid-qif-import.c +++ b/src/import-export/qif-import/druid-qif-import.c @@ -220,7 +220,7 @@ get_next_druid_page(QIFImportWindow * wind, GnomeDruidPage * page) if((current = g_list_find(wind->commodity_pages, page)) == NULL) { if((current = g_list_find(wind->post_comm_pages, page)) == NULL) { /* Where are we? */ - printf("QIF import: I'm lost!\n"); + g_critical("QIF import: BUG DETECTED in get_next_druid_page! I'm lost!"); return FALSE; } else { @@ -253,7 +253,7 @@ get_next_druid_page(QIFImportWindow * wind, GnomeDruidPage * page) next = wind->post_comm_pages; break; default: - printf("QIF import: something fishy.\n"); + g_critical("QIF import: BUG DETECTED in get_next_druid_page!"); next = NULL; if (where > 3) return NULL; @@ -287,7 +287,7 @@ get_prev_druid_page(QIFImportWindow * wind, GnomeDruidPage * page) if((current = g_list_find(wind->commodity_pages, page)) == NULL) { if((current = g_list_find(wind->post_comm_pages, page)) == NULL) { /* Where are we? */ - printf("QIF import: I'm lost!\n"); + g_critical("QIF import: BUG DETECTED in get_prev_druid_page! I'm lost!"); return NULL; } else { @@ -340,7 +340,7 @@ get_prev_druid_page(QIFImportWindow * wind, GnomeDruidPage * page) break; default: if (wind->show_doc_pages) - printf("QIF import: something fishy.\n"); + g_critical("QIF import: BUG DETECTED in get_prev_druid_page!"); prev = NULL; if (where < 1) return NULL; @@ -1718,7 +1718,7 @@ gnc_ui_qif_import_commodity_prepare_cb(GnomeDruidPage * page, /* this shouldn't happen, but DTRT if it does */ if (SCM_NULLP(wind->new_stocks)) { - printf("somehow got to commodity doc page with nothing to do... BUG!\n"); + g_warning("QIF import: BUG DETECTED! Reached commodity doc page with nothing to do!"); gnc_ui_qif_import_convert(wind); } diff --git a/src/import-export/qif-import/qif-file.scm b/src/import-export/qif-import/qif-file.scm index e3c90bb05f..189fd0f610 100644 --- a/src/import-export/qif-import/qif-file.scm +++ b/src/import-export/qif-import/qif-file.scm @@ -140,9 +140,9 @@ (if (string-match "^option:" (symbol->string qstate-type)) (begin - (display "qif-file:read-file ignoring ") - (write qstate-type) - (newline) + (gnc:warn "qif-file:read-file:" + " ignoring '" qstate-type + "' option.") (set! qstate-type old-qstate)))))) @@ -314,10 +314,9 @@ (set! current-xtn (make-qif-class))) (else - (display "qif-file:read-file : unknown Class slot ") - (display tag) - (display " .. continuing anyway.") - (newline)))) + (gnc:warn "qif-file:read-file:" + " ignoring class '" tag "' line." + "\nLine content: [" line "]")))) ;;;;;;;;;;;;;;;;;; @@ -385,9 +384,9 @@ (set! current-xtn (make-qif-cat))) (else - (display "qif-file:read-file : unknown Cat slot ") - (display tag) - (display " .. continuing anyway") (newline)))) + (gnc:warn "qif-file:read-file:" + " ignoring category '" tag "' line." + "\nLine content: [" line "]")))) ;;;;;;;;;;;;;;;;;;; @@ -418,10 +417,9 @@ (set! current-xtn (make-qif-stock-symbol))) (else - (display "qif-file:read-file : unknown Security slot ") - (display tag) - (display " .. continuing anyway.") - (newline)))) + (gnc:warn "qif-file:read-file:" + " ignoring security '" tag "' line." + "\nLine content: [" line "]")))) ;; trying to sneak one by, eh? @@ -429,10 +427,9 @@ (if (and (not qstate-type) (not (string=? (string-trim line) ""))) (begin - (display "line = ") (display line) (newline) - (display "qif-file:read-file : ") - (display "file does not appear to be a QIF file.") - (newline) + (gnc:warn "qif-file:read-file:" + " file does not appear to be a QIF." + "\nLine content: [" line "]") (set! return-val (list #f "File does not appear to be a QIF file.")) (set! heinous-error #t)))))) diff --git a/src/import-export/qif-import/qif-guess-map.scm b/src/import-export/qif-import/qif-guess-map.scm index 9ef2f08517..01506b41fb 100644 --- a/src/import-export/qif-import/qif-guess-map.scm +++ b/src/import-export/qif-import/qif-guess-map.scm @@ -218,7 +218,8 @@ (gnc-commodity-get-namespace value) (gnc-commodity-get-mnemonic value)) table)) - (display "write-commodities: something funny in hash table.\n")) + (gnc:warn "qif-import:write-commodities:" + " something funny in hash table.")) #f) #f hashtab) (write table))) diff --git a/src/import-export/qif-import/qif-parse.scm b/src/import-export/qif-import/qif-parse.scm index f23b3b8615..c3feeac4c8 100644 --- a/src/import-export/qif-import/qif-parse.scm +++ b/src/import-export/qif-import/qif-parse.scm @@ -64,8 +64,7 @@ #f)))) rv) (begin - (display "qif-split:parse-category : can't parse ") - (display value) (newline) + (gnc:warn "qif-split:parse-category: can't parse [" value "].") (list "" #f #f))))) @@ -85,9 +84,8 @@ ;; thanks dave p for reporting this. (if (eq? (string-ref year-string 0) #\') (begin - (display "qif-file:fix-year : found a weird QIF Y2K year : |") - (display year-string) - (display "|") (newline) + (gnc:warn "qif-file:fix-year: found weird QIF Y2K year [" + year-string "].") (set! fixed-string (substring year-string 2 (string-length year-string)))) (set! fixed-string year-string)) @@ -129,9 +127,8 @@ ;; No idea what the string represents. Maybe a new bug in Quicken! (#t - (display "qif-file:fix-year : ay caramba! What is this? |") - (display year-string) - (display "|") (newline))) + (gnc:warn "qif-file:fix-year: ay caramba! What is this? [" + year-string "]."))) y2k-fixed-value)) @@ -165,10 +162,9 @@ ((string=? mangled-string "mutual") (list GNC-BANK-TYPE)) (#t - (display "qif-parse:parse-acct-type : unhandled account type ") - (display read-value) - (display "... substituting Bank.") - (newline) + (gnc:warn "qif-parse:parse-acct-type: unrecognized account type [" + read-value + "]... substituting Bank.") (list GNC-BANK-TYPE))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -464,10 +460,8 @@ ;; if the date parts list doesn't have 3 parts, we're in ;; trouble (if (not (eq? 3 (length date-parts))) - (begin - (display "qif-parse:parse-date/format : can't interpret date ") - (display date-string) (display " ") (write date-parts)(newline)) - + (gnc:warn "qif-parse:parse-date/format: can't interpret date [" + date-string "]\nDate parts: " date-parts) (case format ((d-m-y) (let ((d (car numeric-date-parts)) @@ -476,10 +470,9 @@ (if (and (integer? d) (integer? m) (integer? y) (<= m 12) (<= d 31)) (set! retval (list d m y)) - (begin - (display "qif-parse:parse-date/format : ") - (display "format is d/m/y, but date is ") - (display date-string) (newline))))) + (gnc:warn "qif-parse:parse-date/format: " + "format is d/m/y, but date is [" + date-string "].")))) ((m-d-y) (let ((m (car numeric-date-parts)) @@ -488,10 +481,9 @@ (if (and (integer? d) (integer? m) (integer? y) (<= m 12) (<= d 31)) (set! retval (list d m y)) - (begin - (display "qif-parse:parse-date/format : ") - (display " format is m/d/y, but date is ") - (display date-string) (newline))))) + (gnc:warn "qif-parse:parse-date/format: " + "format is m/d/y, but date is [" + date-string "].")))) ((y-m-d) (let ((y (qif-parse:fix-year (car date-parts) 50)) @@ -500,10 +492,9 @@ (if (and (integer? d) (integer? m) (integer? y) (<= m 12) (<= d 31)) (set! retval (list d m y)) - (begin - (display "qif-parse:parse-date/format :") - (display " format is y/m/d, but date is ") - (display date-string) (newline))))) + (gnc:warn "qif-parse:parse-date/format: " + "format is y/m/d, but date is [" + date-string "].")))) ((y-d-m) (let ((y (qif-parse:fix-year (car date-parts) 50)) @@ -512,10 +503,9 @@ (if (and (integer? d) (integer? m) (integer? y) (<= m 12) (<= d 31)) (set! retval (list d m y)) - (begin - (display "qif-parse:parse-date/format : ") - (display " format is y/m/d, but date is ") - (display date-string) (newline))))))) + (gnc:warn "qif-parse:parse-date/format: " + "format is y/d/m, but date is [" + date-string "].")))))) retval)) diff --git a/src/import-export/qif-import/qif-to-gnc.scm b/src/import-export/qif-import/qif-to-gnc.scm index 1c2b83c13e..857346adc6 100644 --- a/src/import-export/qif-import/qif-to-gnc.scm +++ b/src/import-export/qif-import/qif-to-gnc.scm @@ -608,9 +608,8 @@ ;; I don't think this should ever happen, but I want ;; to keep this check just in case. (if (> (length splits) 1) - (begin - (display "qif-import:qif-xtn-to-gnc-xtn : ") - (display "splits in stock transaction!") (newline))) + (gnc:warn "qif-import:qif-xtn-to-gnc-xtn: " + "splits in stock transaction!")) (set! qif-accts (qif-split:accounts-affected (car (qif-xtn:splits qif-xtn))