commit ae31e1695268347de373eedf187523ac5736b438
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Tue Mar 8 11:53:10 2022 -0500

    lyx2lyx: prefix warning messages with "lyx2lyx"
    
    Both lyx2lyx and LyX write output to the terminal, and it's helpful
    to know which messages are coming from lyx2lyx. For example, before
    this commit if we opened a document in LyX that has a newer file format than
    lyx2lyx can deal with, we see the following output in the terminal:
    
      Warning: 619: Format not supported.
      Warning: Quitting.
      Error: Document format failure
    
    The first two lines (the warnings) are output from lyx2lyx, and the
    third is output by LyX. This output was particularly confusing
    because I first thought "LyX tries to quit if the document is too
    new?", but in fact LyX still stays open; it just doesn't open the
    document. After this change, the output is now the following:
    
      lyx2lyx warning: 619: Format not supported.
      lyx2lyx warning: Quitting.
      Error: Document format failure
---
 lib/lyx2lyx/LyX.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/lyx2lyx/LyX.py b/lib/lyx2lyx/LyX.py
index 3d62da5..50c98d2 100644
--- a/lib/lyx2lyx/LyX.py
+++ b/lib/lyx2lyx/LyX.py
@@ -294,7 +294,7 @@ class LyX_base:
         """ Emits warning to self.error, if the debug_level is less
         than the self.debug."""
         if debug_level <= self.debug:
-            self.err.write("Warning: " + message + "\n")
+            self.err.write("lyx2lyx warning: " + message + "\n")
 
 
     def error(self, message):
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to