Skip to content
Snippets Groups Projects
Commit 0bf5063d authored by Nick Draper's avatar Nick Draper
Browse files

Use sphinx warn for logging errors

re #22143
parent 7f0f5a95
No related branches found
No related tags found
No related merge requests found
...@@ -40,7 +40,7 @@ public: ...@@ -40,7 +40,7 @@ public:
const std::string summary() const override; const std::string summary() const override;
/// Algorithm's seeAlso /// Algorithm's seeAlso
const std::vector<std::string> seeAlso() const override { const std::vector<std::string> seeAlso() const override {
return{ "Rebin", "RebinByPulseTime" }; return{ "Rebin", "RebinByPulseTimes" };
} }
private: private:
......
...@@ -99,7 +99,8 @@ class BaseDirective(Directive): ...@@ -99,7 +99,8 @@ class BaseDirective(Directive):
if pagetitle: if pagetitle:
level = 1 level = 1
if level not in level_dict: if level not in level_dict:
print('base.make_header: did not understand level ' +str(level)) env = self.state.document.settings.env
env.app.warn('base.make_header - Did not understand level ' +str(level))
level = 2 level = 2
line = "\n" + level_dict[level] * (len(name)) + "\n" line = "\n" + level_dict[level] * (len(name)) + "\n"
......
...@@ -21,20 +21,21 @@ class SeeAlsoDirective(AlgorithmBaseDirective): ...@@ -21,20 +21,21 @@ class SeeAlsoDirective(AlgorithmBaseDirective):
for seeAlsoEntry in seeAlsoList: for seeAlsoEntry in seeAlsoList:
#test the algorithm exists #test the algorithm exists
try: try:
alg = self.create_mantid_algorithm_by_name(seeAlsoEntry) alg = self.create_mantid_algorithm_by_name(seeAlsoEntry)
link_rst += ":ref:`%s <algm-%s>`, " % (alg.name(), alg.name()) link_rst += ":ref:`%s <algm-%s>`, " % (alg.name(), alg.name())
except RuntimeError: except RuntimeError:
print('SeeAlso: Could not find algorithm "{0}" listed in the seeAlso for {1}.v{2}'.format( env = self.state.document.settings.env
seeAlsoEntry,self.algorithm_name(), self.algorithm_version())) env.app.warn('SeeAlso - Could not find algorithm "{0}" listed in the seeAlso for {1}.v{2}'.format(
seeAlsoEntry,self.algorithm_name(), self.algorithm_version()))
if link_rst or alias: if link_rst or alias:
self.add_rst(self.make_header("See Also",level=3)) self.add_rst(self.make_header("See Also",level=3))
if link_rst: if link_rst:
link_rst = link_rst.rstrip(", ") # remove final separator link_rst = link_rst.rstrip(", ") # remove final separator
self.add_rst(link_rst + "\n\n") self.add_rst(link_rst + "\n\n")
if alias: if alias:
format_str = "This algorithm is also known as: **%s**" format_str = "This algorithm is also known as: **%s**"
self.add_rst(format_str % alias) self.add_rst(format_str % alias)
return [] return []
def setup(app): def setup(app):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment