From e0a9f2beaa2b434e7c44227eaac9c3f8c49ed5f2 Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer Date: Mon, 15 Aug 2011 20:16:07 +0200 Subject: [PATCH] Loglevels: Add basic_progress and replace success -) Add basic_progress function -) use it for 'Processing xxx.ly...' message -) new ly:basic-progress -) get rid of the success function, use basic_progress instead --- Documentation/contributor/programming-work.itexi | 4 ++-- flower/include/warn.hh | 2 +- flower/warn.cc | 4 ++-- lily/lily-parser-scheme.cc | 3 +-- lily/warn-scheme.cc | 6 +++--- scm/documentation-lib.scm | 2 +- scm/lily.scm | 10 +++++----- 7 files changed, 15 insertions(+), 16 deletions(-) diff --git a/Documentation/contributor/programming-work.itexi b/Documentation/contributor/programming-work.itexi index aa243e0e0c..8fa3d6ed9c 100644 --- a/Documentation/contributor/programming-work.itexi +++ b/Documentation/contributor/programming-work.itexi @@ -795,7 +795,7 @@ treated as if @code{Input::error} was called. @tab @code{Input::warning (msg)} @item BASIC -@tab @code{successful (msg)} +@tab @code{basic_progress (msg)} @tab - @item PROGRESS @@ -855,7 +855,7 @@ treated as if @code{Input::error} was called. @tab @code{(ly:input-warning input msg args)} @item BASIC -@tab @code{(ly:success msg args)} +@tab @code{(ly:basic-progress msg args)} @tab - @item PROGRESS diff --git a/flower/include/warn.hh b/flower/include/warn.hh index 7d381f1f08..3b66f65b7b 100644 --- a/flower/include/warn.hh +++ b/flower/include/warn.hh @@ -47,7 +47,7 @@ void error (string s, string location = ""); // Fatal error, exits lilypond! void programming_error (string s, string location = ""); void non_fatal_error (string, string location = ""); void warning (string s, string location = ""); -void successful (string s, string location = ""); +void basic_progress (string s, string location = ""); /* progress_indication does by default *NOT* start on a new line */ void progress_indication (string s, bool newline = false, string location = ""); void message (string s, bool newline = true, string location = ""); diff --git a/flower/warn.cc b/flower/warn.cc index 870420380e..a6e1fa5f90 100644 --- a/flower/warn.cc +++ b/flower/warn.cc @@ -162,9 +162,9 @@ warning (string s, string location) /* Display a success message. */ void -successful (string s, string location) +basic_progress (string s, string location) { - print_message (LOG_BASIC, location, _f ("success: %s", s) + "\n", true); + print_message (LOG_BASIC, location, s + "\n", true); } /* Display information about the progress. */ diff --git a/lily/lily-parser-scheme.cc b/lily/lily-parser-scheme.cc index dc6b652b3d..0848ec70f6 100644 --- a/lily/lily-parser-scheme.cc +++ b/lily/lily-parser-scheme.cc @@ -114,8 +114,7 @@ LY_DEFINE (ly_parse_file, "ly:parse-file", sources.set_path (&global_path); string mapped_fn = map_file_name (file_name); - message (_f ("Processing `%s'", mapped_fn.c_str ())); - progress_indication ("\n"); + basic_progress (_f ("Processing `%s'", mapped_fn.c_str ())); Lily_parser *parser = new Lily_parser (&sources); diff --git a/lily/warn-scheme.cc b/lily/warn-scheme.cc index 1587d7f5ab..69fba1b8b7 100644 --- a/lily/warn-scheme.cc +++ b/lily/warn-scheme.cc @@ -85,14 +85,14 @@ LY_DEFINE (ly_progress, "ly:progress", return SCM_UNSPECIFIED; } -LY_DEFINE (ly_success, "ly:success", +LY_DEFINE (ly_basic_progress, "ly:basic-progress", 1, 0, 1, (SCM str, SCM rest), - "A Scheme callable function to issue a success message @var{str}." + "A Scheme callable function to issue a basic progress message @var{str}." " The message is formatted with @code{format} and @var{rest}.") { LY_ASSERT_TYPE (scm_is_string, str, 1); str = scm_simple_format (SCM_BOOL_F, str, rest); - successful (ly_scm2string (str)); + basic_progress (ly_scm2string (str)); return SCM_UNSPECIFIED; } diff --git a/scm/documentation-lib.scm b/scm/documentation-lib.scm index 013cc2a437..a033186067 100644 --- a/scm/documentation-lib.scm +++ b/scm/documentation-lib.scm @@ -56,7 +56,7 @@ (node-children node))) (define (processing name) - (ly:message (_ "Processing ~S...") name)) + (ly:basic-progress (_ "Processing ~S...") name)) (define (self-evaluating? x) (or (number? x) (string? x) (procedure? x) (boolean? x))) diff --git a/scm/lily.scm b/scm/lily.scm index 55d989e2d2..91b34e290a 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -642,7 +642,7 @@ LilyPond safe mode. The syntax is the same as `define*-public'." ".scm")) (outfile (open-file out-file-name "w"))) (set! gc-dumping #t) - (format #t "Dumping GC statistics ~a...\n" out-file-name) + (ly:progress "Dumping GC statistics ~a...\n" out-file-name) (for-each (lambda (y) (let ((x (car y)) (c (cdr y))) @@ -662,16 +662,16 @@ LilyPond safe mode. The syntax is the same as `define*-public'." (newline outfile) (if (defined? 'gc-live-object-stats) (let* ((stats #f)) - (display "Live object statistics: GC'ing\n") + (ly:progress "Live object statistics: GC'ing\n") (ly:reset-all-fonts) (gc) (gc) - (display "Asserting dead objects\n") + (ly:progress "Asserting dead objects\n") (ly:set-option 'debug-gc-assert-parsed-dead #t) (gc) (ly:set-option 'debug-gc-assert-parsed-dead #f) (set! stats (gc-live-object-stats)) - (display "Dumping live object statistics.\n") + (ly:progress "Dumping live object statistics.\n") (dump-live-object-stats outfile))) (newline outfile) (let* ((stats (gc-stats))) @@ -727,7 +727,7 @@ PIDs or the number of the process." "Exit function for lilypond" (if (not silently) (case status - ((0) (ly:success (_ "Compilation successfully completed"))) + ((0) (ly:basic-progress (_ "Success: compilation successfully completed"))) ((1) (ly:warning (_ "Compilation completed with warnings or errors"))) (else (ly:message "")))) (exit status)) -- 2.39.2