Ticket #9059 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Simplify Logger class to not store created instances in static list

Reported by: Martyn Gigg Owned by: Martyn Gigg
Priority: major Milestone: Release 3.2
Component: Framework Keywords: Maintenance
Cc: Blocked By:
Blocking: Tester: Nick Draper

Description (last modified by Martyn Gigg) (diff)

The Logger::get method currently creates a new Logger object & inserts this into a static list and waits for a user to call release so that it can be deleted. This is all a bit convoluted and harks back to when we used to cache Logger instances.

This is no longer the case and it would be better if the class could be constructed as normal and then let the users decide how to manage the new instances.

Change History

comment:1 Changed 7 years ago by Nick Draper

  • Status changed from new to assigned

comment:3 Changed 7 years ago by Martyn Gigg

  • Description modified (diff)
  • Summary changed from Change Logger::get to return shared_ptr to Simplify Logger class to not store created instances in static list

comment:3 Changed 7 years ago by Martyn Gigg

  • Status changed from assigned to inprogress

Add a performance test for the logging framework.

Refs #9059

Changeset: 0b7bcfdd54d6eb9d0b542ab89203c0bea07aeaf2

comment:4 Changed 7 years ago by Martyn Gigg

Refactor Logger to be a normal class that can be instantiated.

Refs #9059

Changeset: e970b351c4706add0bb98470ae13a5ca341bb8d7

comment:5 Changed 7 years ago by Martyn Gigg

Kernel/KernelTest builds & tests pass

Refs #9059

Changeset: 6e92fad22c8c42defeea1c2bb6d9bdc28035b7b2

comment:6 Changed 7 years ago by Martyn Gigg

Geometry/GeometryTest compiles & the tests pass.

Refs #9059

Changeset: 111e89d88a9f29e0104decbccdfed9ee0e86a43d

comment:7 Changed 7 years ago by Martyn Gigg

API & APITest compiles.

Refs #9059

Changeset: c99e3ae2212d7009de7a1a529cca3e6cdc367564

comment:8 Changed 7 years ago by Martyn Gigg

DataObjects/test pass

Refs #9059

Changeset: fe44d24c465f393d0cf5d86df2804693c537280d

comment:9 Changed 7 years ago by Martyn Gigg

Python compiles and the tests pass.

Refs #9059

Changeset: ebb75011696f783e3ca326a1924d7ebf60f2d0a6

comment:10 Changed 7 years ago by Martyn Gigg

Remove unnecessary additional logger references.

Just use the base class one. Refs #9059

Changeset: 5f9da7811db41fdc62a5bd983042776cc3574987

comment:11 Changed 7 years ago by Martyn Gigg

DataHandling compiles

Move static loggers to cpp files and remove some unnecessary loggers Refs #9059

Changeset: 25d862996719f3f103bfb1ddfa6b79ad7d42567e

comment:12 Changed 7 years ago by Martyn Gigg

Crystal now compiles but not tests. They depend on MDEvents...

Refs #9059

Changeset: b53200102debb4a45d79641d0d9bc4f85a0df48c

comment:13 Changed 7 years ago by Martyn Gigg

MDEvents & tests compile

Refs #9059

Changeset: 0165823fd09d36f2d67ac8377b202d13292cef0a

comment:14 Changed 7 years ago by Martyn Gigg

MDAlgorithms & tests compile.

Refs #9059

Changeset: 002399749e1d04c1903efcd7156486cd47798440

comment:15 Changed 7 years ago by Martyn Gigg

CurveFitting compiles

Refs #9059

Changeset: e41551a06f582fa246efec1c3a089865e1fd56a0

comment:16 Changed 7 years ago by Martyn Gigg

ICat & tests now compile

Refs #9059

Changeset: b235d202be29e7408e44478f9de7bd904527ffe6

comment:17 Changed 7 years ago by Martyn Gigg

WorkflowAlgorithms compiles.

Refs #9059

Changeset: 5e60ffaf52a00b751202fcb71e0e82cefc38750d

comment:18 Changed 7 years ago by Martyn Gigg

LiveData & tests compile

Refs #9059

Changeset: 6ed4fe6030935407a82a5622e066a4248db1a49c

comment:19 Changed 7 years ago by Martyn Gigg

SINQ & tests compiles

Refs #9059

Changeset: 7892e727e3b57be0f5f46c7312123eb1ee92c946

comment:20 Changed 7 years ago by Martyn Gigg

ScriptRepository compiles

Refs #9059

Changeset: a4af45b36a34bf77fdb4eda4f9bb2eeb4cfa54fd

comment:21 Changed 7 years ago by Martyn Gigg

MantidQt API library compiles

Refs #9059

Changeset: a4e53eb5e9227ca5f81eb0feb38851d201b30a63

comment:22 Changed 7 years ago by Martyn Gigg

MantidWidgets library compiles

Refs #9059

Changeset: 881164ba511b8895e4dc6cf3fdb1e29012bd34e5

comment:23 Changed 7 years ago by Martyn Gigg

SpectrumViewer lib compiles.

Refs #9059

Changeset: 39812c47a631d961f7f97efa050e7aed4cea6a13

comment:24 Changed 7 years ago by Martyn Gigg

SliceViewer lib compiles

Refs #9059

Changeset: 85c151e09796841d6e05ddc36ffc2edd13f6dd46

comment:25 Changed 7 years ago by Martyn Gigg

MantidQt CustomInterfaces compiles.

Refs #9059

Changeset: d81efc616c4cda3a3ca6be9c213b33d199b3372c

comment:26 Changed 7 years ago by Martyn Gigg

MantidPlot exe compiles

Refs #9059

Changeset: ce68409f5d71595d15c7c29630b2d4c2ec4e91e4

comment:27 Changed 7 years ago by Martyn Gigg

Vates libraries & app compiles.

Refs #9059

Changeset: bbdb2cb203da47aeb1fbb8fc336a44a08e838235

comment:28 Changed 7 years ago by Martyn Gigg

Put back static Logger in IFunction1D.

Refs #9059

Changeset: 309006c73570b8e5123d2aa696fb3a3f4965977f

comment:29 Changed 7 years ago by Martyn Gigg

Merge branch 'feature/9059_refactor_logger' into develop

Conflicts:

Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/SaveANSTOAscii.h Code/Mantid/Framework/DataHandling/src/SaveANSTOAscii.cpp Code/Mantid/Framework/Kernel/test/LoggerTest.h Code/Mantid/Framework/MDAlgorithms/src/ConvertToMD.cpp

Refs #9059

Changeset: 81d17cf85ad63b459bd61c1266c8b2de29ce7a01

comment:30 Changed 7 years ago by Martyn Gigg

Put back static Logger in IFunction1D.

Refs #9059

Changeset: 309006c73570b8e5123d2aa696fb3a3f4965977f

comment:31 Changed 7 years ago by Martyn Gigg

Kill compiler warning about unused variable in LoggerTest

Refs #9059

Changeset: 402f963b2a8590377f4482ee60c851eb419a25fa

comment:32 Changed 7 years ago by Martyn Gigg

Merge remote-tracking branch 'origin/master' into feature/9059_refactor_logger

Conflicts:

Code/Mantid/Framework/MDAlgorithms/src/ConvertToMD.cpp

Refs #9059

Changeset: 0f502d36fe516c32e1400edfe73bcf3c468a2be6

comment:33 Changed 7 years ago by Martyn Gigg

Fix other logger instances after merge from master.

Refs #9059

Changeset: 8182b9cd0384964b166a6712547d7d7f2be6a6ad

comment:34 Changed 7 years ago by Martyn Gigg

Merge branch 'feature/9059_refactor_logger' into develop

Conflicts:

Code/Mantid/Framework/DataHandling/inc/MantidDataHandling/SaveANSTOAscii.h Code/Mantid/Framework/DataHandling/src/SaveANSTOAscii.cpp Code/Mantid/Framework/Kernel/test/LoggerTest.h

Refs #9059

Changeset: 246ea81dc9424e50a178aad2182b24719a0222db

comment:35 Changed 7 years ago by Martyn Gigg

Remove a missed static logger reference in an algorithm.

Refs #9059

Changeset: 5f62d6ff09417ad044e614bde0de88cab818967c

comment:36 Changed 7 years ago by Martyn Gigg

Fix logger call in SANS script.

Refs #9059

Changeset: af590b857787b65ee632218b347a41a87f8ae3eb

comment:37 Changed 7 years ago by Martyn Gigg

Add deprecated Logger.get for Python.

Gives users a little leeway. Refs #9059

Changeset: bc294cfaf6d4353c6727b10efdcdfaf398cf92aa

comment:38 Changed 7 years ago by Martyn Gigg

Put back initializer character for MPI build

Refs #9069

Changeset: 019c2930128cfeb5529ca1a5b6021b72172996e8

comment:39 Changed 7 years ago by Martyn Gigg

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

Branch: feature/9059_refactor_logger

Tester: Check that you can still change the log level from MantidPlot and that you get the detail that you are expecting. There should be no visible change from a user perspective.

comment:40 Changed 7 years ago by Nick Draper

  • Status changed from verify to verifying
  • Tester set to Nick Draper

comment:41 Changed 7 years ago by Nick Draper

Log level still works well in mantid plot and is still preserved across sessions, no apparent change - works as before.

comment:42 Changed 7 years ago by Nick Draper

re #9059 merge conflict

Changeset: 859a50c9e27d873e3c5b3c1658f2c1ff22259030

comment:43 Changed 7 years ago by Nick Draper

  • Status changed from verifying to closed

comment:44 Changed 7 years ago by Martyn Gigg

Fix unresolved merge conflicts.

Refs #9059

Changeset: ce6ac62cc11278a43b16654a7b670a03082c3b42

comment:45 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 9902

Note: See TracTickets for help on using tickets.