Skip to content

Commit 8ff588b

Browse files
committed
better logging
1 parent 7df480a commit 8ff588b

42 files changed

Lines changed: 121 additions & 159 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build_gemc_almalinux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
jobs:
1717
build-on-almalinux:
1818
runs-on: ubuntu-latest
19-
container: jeffersonlab/geant4:g4v11.3.0-almalinux94
19+
container: jeffersonlab/geant4:g4v11.3.1-almalinux94
2020

2121
steps:
2222
- name: Checkout

.github/workflows/build_gemc_fedora.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
jobs:
1717
build-on-fedora:
1818
runs-on: ubuntu-latest
19-
container: jeffersonlab/geant4:g4v11.3.0-fedora36
19+
container: jeffersonlab/geant4:g4v11.3.1-fedora36
2020

2121
steps:
2222
- name: Checkout

.github/workflows/build_gemc_ubuntu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
jobs:
1717
build-on-ubuntu:
1818
runs-on: ubuntu-latest
19-
container: jeffersonlab/geant4:g4v11.3.0-ubuntu24
19+
container: jeffersonlab/geant4:g4v11.3.1-ubuntu24
2020

2121
steps:
2222
- name: Checkout

.github/workflows/sanitize.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ jobs:
2020
matrix:
2121
container:
2222
- name: ubuntu24
23-
image: jeffersonlab/geant4:g4v11.3.0-ubuntu24
23+
image: jeffersonlab/geant4:g4v11.3.1-ubuntu24
2424
- name: fedora36
25-
image: jeffersonlab/geant4:g4v11.3.0-fedora36
25+
image: jeffersonlab/geant4:g4v11.3.1-fedora36
2626
- name: almalinux93
27-
image: jeffersonlab/geant4:g4v11.3.0-almalinux94
27+
image: jeffersonlab/geant4:g4v11.3.1-almalinux94
2828
# to be revisited
2929
# NOTE1: `b_sanitize=memory` is not used because `libc++` needs to be re-compiled with `-fsanitize=memory`, otherwise
3030
# we are bothered by false positives (e.g., from `std::map` insertion)

eventDispenser/eventDispenser.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ using namespace std;
4141
// GDynamicDigitization plugins map.
4242
//
4343
EventDispenser::EventDispenser(GOptions *gopt, map<string, GDynamicDigitization *> *gDDGlobal)
44-
: log(std::make_shared<GLogger>(gopt, EVENTDISPENSER_LOGGER)) , gDigitizationGlobal(gDDGlobal) {
44+
: log(std::make_shared<GLogger>(gopt, EVENTDISPENSER_LOGGER, "EventDispenser")) , gDigitizationGlobal(gDDGlobal) {
4545

4646
log->debug(CONSTRUCTOR, "EventDispenser");
4747

eventDispenser/examples/event_dispenser_example.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
#include "eventDispenser.h"
2525
#include "eventDispenser_options.h"
2626
#include "goptions.h"
27-
#include "glogger.h"
2827

29-
#include <iostream>
3028
#include <map>
3129
#include <string>
3230

@@ -37,7 +35,7 @@ int main(int argc, char *argv[]) {
3735
auto gopts = new GOptions(argc, argv, eventDispenser::defineOptions());
3836

3937
// Create a logger for the EventDispenser module.
40-
auto log = new GLogger(gopts, EVENTDISPENSER_LOGGER);
38+
auto log = std::make_unique<GLogger>(gopts, EVENTDISPENSER_LOGGER, "eventDispenser example");
4139

4240
// For demonstration, create an empty global map of dynamic digitization plugins.
4341
// In a full simulation, this map would be populated with actual GDynamicDigitization plugins.
@@ -54,7 +52,6 @@ int main(int argc, char *argv[]) {
5452

5553
// Cleanup: delete dynamically allocated objects.
5654
delete gopts;
57-
delete log;
5855
delete gDynamicMap;
5956

6057
return EXIT_SUCCESS;

g4dialog/examples/g4dialog_example.cc

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
// geant4
22
#include "G4VisExecutive.hh"
33
#include "G4RunManagerFactory.hh"
4-
#include "FTFP_BERT.hh"
5-
#include "G4StepLimiterPhysics.hh"
64

75
// g4dialog
86
#include "g4dialog.h"
97
#include "g4dialog_options.h"
10-
#include "gui_session.h"
11-
12-
// c++
13-
#include <iostream>
14-
using namespace std;
158

169
// qt
1710
#include <QApplication>
@@ -20,7 +13,7 @@ using namespace std;
2013
int main(int argc, char* argv[]) {
2114

2215
auto gopts = new GOptions(argc, argv, g4dialog::defineOptions());
23-
auto log = new GLogger(gopts, G4DIALOG_LOGGER);
16+
auto log = std::make_shared<GLogger>(gopts, G4DIALOG_LOGGER, "g4dialog example");
2417

2518
QApplication app(argc, argv);
2619

@@ -47,5 +40,7 @@ int main(int argc, char* argv[]) {
4740
delete window;
4841
delete visManager;
4942
delete gopts;
43+
5044
return EXIT_SUCCESS;
45+
5146
}

g4dialog/g4dialog.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include "G4UImanager.hh"
99

1010

11-
G4Dialog::G4Dialog(GOptions *gopt, QWidget *parent) : QWidget(parent), log(new GLogger(gopt, G4DIALOG_LOGGER)) {
11+
G4Dialog::G4Dialog(GOptions *gopt, QWidget *parent) : QWidget(parent), log(std::make_shared<GLogger>(gopt, G4DIALOG_LOGGER, "G4Dialog")) {
1212

1313
log->debug(CONSTRUCTOR, "G4Dialog");
1414

g4dialog/g4dialog.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef G4DIALOG_H
2-
#define G4DIALOG_H 1
1+
#pragma once
32

43
// g4dialog
54
#include "tabs/gboard.h"
@@ -19,14 +18,11 @@ class G4Dialog : public QWidget {
1918
~G4Dialog() override {
2019
log->debug(DESTRUCTOR, "G4Dialog");
2120
delete gboard;
22-
delete log;
2321
}
2422

2523
private:
26-
GLogger * const log;
24+
std::shared_ptr<GLogger> log;
2725
GBoard* gboard;
2826
GUI_Session *gui_session;
2927
};
3028

31-
32-
#endif

g4dialog/gui_session.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include <QRegularExpression>
55

6-
GUI_Session::GUI_Session(GOptions *gopt, GBoard* b) : board(b), log(new GLogger(gopt, G4DIALOG_LOGGER)) {
6+
GUI_Session::GUI_Session(GOptions *gopt, GBoard* b) : board(b), log(new GLogger(gopt, G4DIALOG_LOGGER, "GUI_Session")) {
77

88
log->debug(CONSTRUCTOR, "GUI_Session");
99
log->info(0, " g4 dialog : GUI_Session created");

0 commit comments

Comments
 (0)