Ticket #1410 (closed: fixed)

Opened 10 years ago

Last modified 5 years ago

Add the algorithm name to the loggers

Reported by: Peter Peterson Owned by: Peter Peterson
Priority: minor Milestone: Iteration 25
Component: Mantid Keywords:
Cc: Blocked By:
Blocking: Tester: Janik Zikovsky

Description (last modified by Peter Peterson) (diff)

It helps in debugging if you know what algorithm is creating the log messages. With a simple

this->g_log.setName("LoadInstrument");

in an algorithms init() you can get more meaningful messages.

Change History

comment:1 Changed 10 years ago by Peter Peterson

  • Status changed from new to accepted
  • Owner set to Peter Peterson

The bit of macro processor missing should show:

this->g_log.setName("LoadInstrument");

comment:2 Changed 10 years ago by Peter Peterson

The namespace should be included as well. For example

this->g_log.setName("DataHandling::AlignDetectors");

comment:3 Changed 10 years ago by Peter Peterson

(In [5290]) Adding algorithm name to logger. Refs #1410.

comment:4 Changed 10 years ago by Peter Peterson

(In [5292]) Adding algorithm name to logger. Refs #1410.

comment:5 Changed 10 years ago by Peter Peterson

(In [5295]) Adding algorithm name to logger. Refs #1410.

comment:6 Changed 10 years ago by Peter Peterson

  • Description modified (diff)
  • Milestone changed from Iteration 24 to Ongoing

comment:7 Changed 10 years ago by Michael Reuter

(In [6897]) Adding algorithm name to logger. This refs #1410.

comment:8 Changed 10 years ago by Russell Taylor

(In [6910]) When initializing an algorithm from a proxy (i.e. when in MantidPlot), call the main initialize() instead of directly going to the algorithm's virtual init() method. This is cleaner, and solves the immediate problem that the logger name was not being set to that of the algorithm when running within MantidPlot. Re #1410.

comment:9 Changed 10 years ago by Russell Taylor

  • Status changed from accepted to verify
  • Resolution set to fixed

(In [6913]) Clean-up of manual setting of algorithm name for logger. Fixes #1410.

comment:10 Changed 10 years ago by Nick Draper

  • Component set to Mantid
  • Milestone changed from Ongoing to Iteration 25

comment:11 Changed 10 years ago by Janik Zikovsky

  • Status changed from verify to verifying
  • Tester set to Janik Zikovsky

comment:12 Changed 10 years ago by Janik Zikovsky

  • Status changed from verifying to closed

All algorithms I've checked had the logging name set properly.

comment:13 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 2257

Note: See TracTickets for help on using tickets.