Logo ROOT  
Reference Guide
TProofProgressLog.cxx
Go to the documentation of this file.
1 // @(#)root/sessionviewer:$Id$
2 // Author: G Ganis, Jul 2005
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #include "TError.h"
13 #include "TPRegexp.h"
14 #include "TGFrame.h"
15 #include "TGTextView.h"
16 #include "TGLabel.h"
17 #include "TProof.h"
18 #include "TProofProgressDialog.h"
19 #include "TProofProgressLog.h"
20 #include "TProofLog.h"
21 #include "TGNumberEntry.h"
22 #include "TGListBox.h"
23 #include "TGButton.h"
24 
25 const UInt_t kLogElemFilled = BIT(17); // If the log element has been retrieved at least once
26 const UInt_t kDefaultActive = BIT(18); // If the log element is active by default
27 
28 
29 /** \class TProofProgressLog
30  \ingroup sessionviewer
31 
32 Dialog used to display Proof session logs from the Proof progress
33 dialog.
34 It uses TProofMgr::GetSessionLogs() mechanism internally
35 
36 */
37 
38 
40 
41 ////////////////////////////////////////////////////////////////////////////////
42 /// Create a window frame for log messages.
43 
45  TGTransientFrame(gClient->GetRoot(), gClient->GetRoot(), w, h)
46 {
47  fDialog = d;
49  fSessionIdx = 0;
50 
51  Init(w, h);
52 }
53 
54 ////////////////////////////////////////////////////////////////////////////////
55 /// Create a window frame for log messages.
56 
58  TGTransientFrame(gClient->GetRoot(), gClient->GetRoot(), w, h)
59 {
60  fDialog = 0;
61  fSessionUrl = url;
62  fSessionIdx = (idx > 0) ? -idx : idx;
63 
64  Init(w, h);
65 }
66 
67 ////////////////////////////////////////////////////////////////////////////////
68 /// Init window frame for log messages.
69 
71 {
72  fProofLog = 0;
73  fFullText = kFALSE;
74  fTextType = kStd;
75  // use hierarchical cleaning
77 
78  //The text window
79  TGHorizontalFrame *htotal = new TGHorizontalFrame(this, w, h);
80  TGVerticalFrame *vtextbox = new TGVerticalFrame(htotal, w, h);
81  //fText = new TGTextView(this, w, h);
82  fText = new TGTextView(vtextbox, w, h);
83  vtextbox->AddFrame(fText, new TGLayoutHints(kLHintsTop | kLHintsExpandX | kLHintsExpandY, 3, 3, 3, 3));
84 
85  //The frame for choosing workers
86  fVworkers = new TGVerticalFrame(htotal);
87  // URL choice
88  TGLabel *laburl = new TGLabel(fVworkers, "Enter cluster URL:");
89  fVworkers->AddFrame(laburl, new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 2, 2, 2));
93  //The lower row of number entries and buttons
94  TGHorizontalFrame *hfurlbox = new TGHorizontalFrame(fVworkers, 20, 20);
95  TGLabel *labsess = new TGLabel(hfurlbox, "Enter session:");
96  hfurlbox->AddFrame(labsess, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 5, 2, 2, 2));
97  fSessNum = new TGNumberEntry(hfurlbox, 0, 5, -1, TGNumberFormat::kNESInteger);
100  fSessNum->GetNumberEntry()->SetToolTipText("Use 0 for the last known one,"
101  " negative numbers for the previous ones, e.g. -1 for the last-but-one");
102  hfurlbox->AddFrame(fSessNum, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 2, 0, 0, 0));
103  fUrlButton = new TGTextButton(hfurlbox, "Get logs info");
104  fUrlButton->Connect("Clicked()", "TProofProgressLog", this, "Rebuild()");
105  hfurlbox->AddFrame(fUrlButton, new TGLayoutHints(kLHintsCenterY | kLHintsRight, 4, 0, 0, 0));
106  fVworkers->AddFrame(hfurlbox, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX, 2, 2, 2, 2));
107 
108  TGNumberEntry *nent = new TGNumberEntry(hfurlbox);
109  fVworkers->AddFrame(nent, new TGLayoutHints(kLHintsTop | kLHintsLeft, 4, 0, 0, 0));
110 
111  //The list of workers
112  fLogList = 0;
114  fLogList->Resize(102,52);
116 
117  //The SelectAll/ClearAll buttons
118  TGHorizontalFrame *hfselbox = new TGHorizontalFrame(fVworkers, 20, 20);
119  TGLabel *label1 = new TGLabel(hfselbox,"Choose workers:");
120  hfselbox->AddFrame(label1, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 0, 0, 0, 0));
121  TGTextButton *selall = new TGTextButton(hfselbox, " &All ");
122  selall->Connect("Clicked()", "TProofProgressLog", this, "Select(=0)");
123  hfselbox->AddFrame(selall, new TGLayoutHints(kLHintsCenterY | kLHintsRight, 10, 0, 0, 0));
124  TGTextButton *clearall = new TGTextButton(hfselbox, " &Clear ");
125  clearall->Connect("Clicked()", "TProofProgressLog", this, "Select(=1)");
126  hfselbox->AddFrame(clearall, new TGLayoutHints(kLHintsCenterY | kLHintsRight, 10, 0, 0, 0));
127 
128  //select the default actives to start with
129  Select(0, kFALSE);
130 
131  //Display button
132  fLogNew = new TGTextButton(fVworkers, "&Display");
133  fLogNew->Connect("Clicked()", "TProofProgressLog", this, "DoLog(=kFALSE)");
134  //fLogNew->Resize(102, 20);
135  // fLogNew->SetMargins(1, 1, 0, 1);
136  fLogNew->SetTextColor(0xffffff, kFALSE);
137  fLogNew->SetBackgroundColor(0x000044);
138  fVworkers->AddFrame(hfselbox, new TGLayoutHints(kLHintsExpandX | kLHintsTop, 5, 2, 2, 2));
141 
143 
144  //The lower row of number entries and buttons
145  TGHorizontalFrame *hflogbox = new TGHorizontalFrame(vtextbox, 550, 20);
146  fClose = new TGTextButton(hflogbox, " &Close ");
147  fClose->Connect("Clicked()", "TProofProgressLog", this, "CloseWindow()");
149  kLHintsRight, 10, 2, 2, 2));
150 
151  //Saving to a file controls
152  fSave = new TGTextButton(hflogbox, "&Save");
153  fSave->Connect("Clicked()", "TProofProgressLog", this, "SaveToFile()");
154  hflogbox->AddFrame(fSave, new TGLayoutHints(kLHintsCenterY | kLHintsRight, 4, 0, 0, 0));
155  fFileName = new TGTextEntry(hflogbox);
156  fFileName->SetText("<session-tag>.log");
158  TGLabel *label10 = new TGLabel(hflogbox, "Save to a file:");
159  hflogbox->AddFrame(label10, new TGLayoutHints(kLHintsCenterY | kLHintsRight, 50, 2, 2, 2));
160 
161  //Choose the number of lines to display
162  TGVerticalFrame *vlines = new TGVerticalFrame(hflogbox);
163  TGHorizontalFrame *vlines_buttons = new TGHorizontalFrame(vlines);
164  TGLabel *label2 = new TGLabel(vlines_buttons, "Lines:");
165  vlines_buttons->AddFrame(label2, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 2, 2, 2, 2));
166 
167  fAllLines = new TGCheckButton(vlines_buttons, "all");
168  fAllLines->SetToolTipText("Retrieve all lines (service messages excluded)");
170  fAllLines->Connect("Clicked()", "TProofProgressLog", this, "NoLineEntry()");
171  vlines_buttons->AddFrame(fAllLines, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 2, 2, 2, 2));
172 
173  fRawLines = new TGCheckButton(vlines_buttons, "svcmsg");
174  fRawLines->SetToolTipText("Retrieve all type of lines, service messages included");
176  vlines_buttons->AddFrame(fRawLines, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 2, 2, 2, 2));
177 
178  TGLabel *label11 = new TGLabel(vlines_buttons, "From");
179  vlines_buttons->AddFrame(label11, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 2, 2, 2, 2));
180 
181  fLinesFrom = new TGNumberEntry(vlines_buttons, 0, 5, -1, TGNumberFormat::kNESInteger);
182  // coverity[negative_returns]: no problem with -100, the format is kNESInteger
183  fLinesFrom->SetIntNumber(-100);
184  fLinesFrom->GetNumberEntry()->SetToolTipText("Negative values indicate \"tail\" action");
185 
186 
187  vlines_buttons->AddFrame(fLinesFrom, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 2, 2, 2, 2));
188 
189  TGLabel *label3 = new TGLabel(vlines_buttons, "to");
190  vlines_buttons->AddFrame(label3, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 2, 2, 2, 2));
191  fLinesTo = new TGNumberEntry(vlines_buttons, 0, 5, -1, TGNumberFormat::kNESInteger);
192  vlines_buttons->AddFrame(fLinesTo, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 2, 2, 2, 2));
193  vlines->AddFrame(vlines_buttons, new TGLayoutHints(kLHintsCenterY));
194  hflogbox->AddFrame(vlines, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 2, 2, 2, 2));
195 
196  //
197  // Lowest line, with filter (grep or cmd pipe) controls
198  //
199 
200  TGHorizontalFrame *hfgrepbox = new TGHorizontalFrame(vtextbox, 550, 20);
201 
202  // Grep/pipe label, textbox and button
203  fGrepLabel = new TGLabel(hfgrepbox, "");
204  hfgrepbox->AddFrame(fGrepLabel, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 2, 2, 2, 2));
205  fGrepText = new TGTextEntry(hfgrepbox);
206  {
208  fGrepText->SetDefaultSize(400, dim.fHeight);
209  }
211  fGrepButton = new TGTextButton(hfgrepbox, "Filter");
212  fGrepButton->Connect("Clicked()", "TProofProgressLog", this, "DoLog(=kTRUE)");
213  hfgrepbox->AddFrame(fGrepButton, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 4, 10, 0, 0)); // l r t b
214 
215  // Checkbox for inverting selection or giving a pipe command
216  fGrepCheckInv = new TGCheckButton(hfgrepbox, "invert match");
217  fGrepCheckInv->Connect("Clicked()", "TProofProgressLog", this, "SetGrepView()");
218  hfgrepbox->AddFrame(fGrepCheckInv, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 2, 2, 2, 2));
219 
220  fGrepCheckCmd = new TGCheckButton(hfgrepbox, "is a pipe command");
221  fGrepCheckCmd->Connect("Clicked()", "TProofProgressLog", this, "SetGrepView()");
222  hfgrepbox->AddFrame(fGrepCheckCmd, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 2, 2, 2, 2));
223 
224  // fRawLines->SetToolTipText("Retrieve all type of lines, service messages included");
225  // fRawLines->SetState(kButtonUp);
226  // vlines_buttons->AddFrame(fRawLines, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 2, 2, 2, 2));
227 
228  //
229  // Add frames to the global picture
230  //
231 
232  vtextbox->AddFrame(hflogbox, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX, 2, 2, 2, 2));
233  vtextbox->AddFrame(hfgrepbox, new TGLayoutHints(kLHintsBottom | kLHintsLeft | kLHintsExpandX, 2, 2, 2, 2));
234  htotal->AddFrame(vtextbox, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY | kLHintsRight, 3, 3, 3, 3));
236  kLHintsExpandY, 3, 3, 3, 3));
237  SetGrepView();
238  MapSubwindows();
239  Resize();
240  CenterOnParent();
241  Popup();
242 }
243 
244 ////////////////////////////////////////////////////////////////////////////////
245 /// Destructor
246 
248 {
249  // Cleanup the log object
251 
252  // Detach from owner dialog
253  if (fDialog) {
254  fDialog->fLogWindow = 0;
255  fDialog->fProof->Disconnect("LogMessage(const char*,Bool_t)", this,
256  "LogMessage(const char*,Bool_t)");
257  }
258 }
259 
260 ////////////////////////////////////////////////////////////////////////////////
261 /// Show log window.
262 
264 {
265  MapWindow();
266 }
267 
268 ////////////////////////////////////////////////////////////////////////////////
269 /// Clear log window.
270 
272 {
273  if (fText)
274  fText->Clear();
275 }
276 
277 ////////////////////////////////////////////////////////////////////////////////
278 /// Load a text buffer in the window.
279 
280 void TProofProgressLog::LoadBuffer(const char *buffer)
281 {
282  if (fText)
283  fText->LoadBuffer(buffer);
284 }
285 
286 ////////////////////////////////////////////////////////////////////////////////
287 /// Load a file in the window.
288 
290 {
291  if (fText)
292  fText->LoadFile(file);
293 }
294 
295 ////////////////////////////////////////////////////////////////////////////////
296 /// Add text to the window.
297 
298 void TProofProgressLog::AddBuffer(const char *buffer)
299 {
300  if (fText) {
301  TGText txt;
302  txt.LoadBuffer(buffer);
303  fText->AddText(&txt);
304  }
305 }
306 
307 ////////////////////////////////////////////////////////////////////////////////
308 /// Handle close button or when closed via window manager action.
309 
311 {
312  DeleteWindow();
313 }
314 
315 ////////////////////////////////////////////////////////////////////////////////
316 /// Build the list of workers. For this, extract the logs and take the names
317 /// of TProofLogElements
318 
320 {
321  // Set title
322  TString title;
323  title.Form("PROOF - Processing logs for session 'undefined'");
324  SetWindowName(title.Data());
325  SetIconName(title.Data());
326 
327  // Create the list-box now
328  if (create) {
329  if (fLogList) delete fLogList;
331  } else {
332  // Reset
334  fLogList->RemoveEntries(0,nent);
335  fLogList->Layout();
336  }
337 
338  if (fSessionUrl.IsNull()) {
339  if (gDebug > 0)
340  Info("BuildLogList", "session URL undefined - do nothing");
341  return;
342  }
344  if (!mgr || !mgr->IsValid()) {
345  Warning("BuildLogList", "unable open a manager connection to %s",
346  fSessionUrl.Data());
347  return;
348  }
349  if (!(fProofLog = mgr->GetSessionLogs(fSessionIdx,"NR"))) {
350  Warning("BuildLogList", "unable to get logs from %s",
351  fSessionUrl.Data());
352  return;
353  }
354  // Set title
355  title.Form("PROOF - Processing logs for session '%s', started on %s at %s",
357  fProofLog->GetTitle());
358  SetWindowName(title.Data());
359  SetIconName(title.Data());
360 
361  TList *elem = fProofLog->GetListOfLogs();
362  TIter next(elem);
363  TProofLogElem *pe = 0;
364 
365  Int_t is = 0;
366  TGLBEntry *ent = 0;
367  TString buf;
368  while ((pe=(TProofLogElem*)next())){
369  TUrl url(pe->GetTitle());
370  buf.Form("%s %s", pe->GetName(), url.GetHost());
371  fLogList->AddEntry(buf.Data(), is);
372  if ((ent = fLogList->FindEntry(buf.Data()))) {
373  ent->ResetBit(kLogElemFilled);
374  ent->ResetBit(kDefaultActive);
375  if (!(pe->IsWorker())) ent->SetBit(kDefaultActive);
376  }
377  is++;
378  }
379 
380  // Done
381  return;
382 }
383 
384 ////////////////////////////////////////////////////////////////////////////////
385 /// Display logs. 'grep' is set to kTRUE if it is invoked by pressing the
386 /// 'Filter' button.
387 
389 {
390  Clear();
391 
392  if (!fGrepText) {
393  Warning("DoLog", "no text: do nothing!");
394  return;
395  }
396 
397  TString greptext = fGrepText->GetText();
398  greptext.Remove(TString::kBoth, ' ');
399  if (greptext.IsNull()) {
400  grep = kFALSE;
401  }
402  else if (!fGrepCheckCmd->IsOn()) {
403  // Not a command: sanitize string
404  TPMERegexp san("(^|[^\\\\])([^a-zA-Z0-9_=\\\\/.-])");
405  while ( san.Substitute(greptext, "$1\\$2") > 0 );
406  }
407 
408  Int_t from, to;
409  if (fAllLines->IsOn()){
410  from = 0;
411  to = -1;
412  } else {
413  from = fLinesFrom->GetIntNumber();
414  to = fLinesTo->GetIntNumber();
415  }
416 
417  // Create the TProofLog instance
418  if (!fProofLog) {
419  TProofMgr *mgr = 0;
420  if ((mgr = TProof::Mgr(fSessionUrl.Data()))) {
421  if (!(fProofLog = mgr->GetSessionLogs(fSessionIdx, "NR"))) {
422  Warning("DoLog", "unable to instantiate TProofLog for %s",
423  fSessionUrl.Data());
424  }
425  } else {
426  Warning("DoLog", "unable to instantiate a TProofMgr for %s",
427  fSessionUrl.Data());
428  }
429  }
430 
431  // Pipe command for filtering
432  TString pipeCommand;
433 
434  // Filter out SvcMsg
435  if (!fRawLines->IsOn()) {
436  pipeCommand = "grep -v \"| SvcMsg\"";
437  }
438 
439  // Default is not retrieving
441  if (!grep) {
442  // Not invoked via 'Filter' button
443  if (!fFullText ||
444  ((fTextType != kRaw && fRawLines->IsOn()) ||
445  (fTextType != kStd && !fRawLines->IsOn())) ||
447  retrieve = kTRUE;
448  if (fRawLines->IsOn()) {
449  fTextType = kRaw;
450  } else {
451  fTextType = kStd;
452  }
454  fFullText = kTRUE;
455  }
456  } else {
457  retrieve = kTRUE;
458  fTextType = kGrep;
459 
460  if (!pipeCommand.IsNull())
461  pipeCommand.Append('|');
462 
463  if (fGrepCheckCmd->IsOn()) {
464  pipeCommand.Append(greptext);
465  }
466  else {
467  pipeCommand.Append("grep ");
468  if (fGrepCheckInv->IsOn())
469  pipeCommand.Append("-v ");
470  pipeCommand.Append("-- ");
471  pipeCommand.Append(greptext); // sanitized
472  }
473 
475  fFullText = kTRUE;
476  }
477 
478  // Display now
479  if (fProofLog) {
480  TList *selected = new TList;
481  fLogList->GetSelectedEntries(selected);
482  TIter next(selected);
483  TGTextLBEntry *selentry;
484  Bool_t logonly = fProofLog->LogToBox();
486 
487  fProofLog->Connect("Prt(const char*)", "TProofProgressLog",
488  this, "LogMessage(const char*, Bool_t)");
489  while ((selentry=(TGTextLBEntry*)next())){
490  TString ord = selentry->GetText()->GetString();
491  Int_t is = ord.Index(" ");
492  if (is != kNPOS) ord.Remove(is);
493  if (retrieve || !selentry->TestBit(kLogElemFilled)) {
494  pipeCommand.Prepend('|');
495  if (fTextType == kRaw) {
496  if (gDebug >= 2)
497  Info("DoLog", "Retrieving unfiltered log for %s", ord.Data());
499  }
500  else {
501  if (gDebug >= 2)
502  Info("DoLog", "Retrieving log for %s filtered with %s",
503  ord.Data(), pipeCommand.Data());
504  fProofLog->Retrieve(ord.Data(), TProofLog::kGrep, 0, pipeCommand.Data());
505  }
506  selentry->SetBit(kLogElemFilled);
507  }
508  fProofLog->Display(ord.Data(), from, to);
509  }
510  fProofLog->SetLogToBox(logonly);
511  fProofLog->Disconnect("Prt(const char*)", this, "LogMessage(const char*, Bool_t)");
512  delete selected;
513  }
514 }
515 
516 ////////////////////////////////////////////////////////////////////////////////
517 /// Load/append a log msg in the log frame, if open
518 
519 void TProofProgressLog::LogMessage(const char *msg, Bool_t all)
520 {
521  if (all) {
522  // load buffer
523  LoadBuffer(msg);
524  } else {
525  // append
526  AddBuffer(msg);
527  }
528 }
529 
530 ////////////////////////////////////////////////////////////////////////////////
531 ///Save the logs to a file
532 ///Only the name of the file is taken, no expansion
533 
535 {
536  if (!fProofLog) DoLog();
537 
538  // File name: the default is <session-tag>.log
539  TString filename = fFileName->GetText();
540  if (filename.IsNull() || filename == "<session-tag>.log") {
541  filename = (fDialog && fDialog->fProof) ?
542  TString::Format("%s.log", fDialog->fProof->GetName()) :
543  TString("proof.log");
544  }
545 
546  TList *selected = new TList;
547  fLogList->GetSelectedEntries(selected);
548  TIter next(selected);
549  TGTextLBEntry *selentry;
550  Bool_t writemode=kTRUE;
551  const char *option;
552  TString ord;
553  while ((selentry=(TGTextLBEntry*)next())){
554  ord = selentry->GetText()->GetString();
555  Int_t isp = ord.Index(' ');
556  if (isp != kNPOS) ord.Remove(isp);
557  //open the file in "w" mode for the first time
558  option = writemode ? "w" : "a";
559  fProofLog->Save(ord.Data(), filename.Data(), option);
560  writemode=kFALSE;
561  }
562  delete selected;
563 
564  Info("SaveToFile", "logs saved to file %s", filename.Data());
565 }
566 
567 ////////////////////////////////////////////////////////////////////////////////
568 /// Sets the view of grep filters according to the value of checkboxes
569 
571 {
572  if (fGrepCheckCmd->IsOn()) {
573  fGrepLabel->SetText("Pipe log through command:");
575  }
576  else {
577  fGrepLabel->SetText("Grep:");
578  Bool_t u = fGrepCheckInv->IsOn();
580  if (u) {
581  fGrepLabel->SetText("Show lines not matching:");
583  }
584  else {
585  fGrepLabel->SetText("Show lines matching:");
587  }
588  }
589 
590  // Ugly but necessary const_cast
591  TGFrame *frame = dynamic_cast<TGFrame *>( const_cast<TGWindow *>(fGrepLabel->GetParent()) );
592  if (frame) frame->Layout();
593 
594 }
595 
596 ////////////////////////////////////////////////////////////////////////////////
597 ///Enable/disable the line number entry
598 
600 {
601  if (fAllLines->IsOn()){
602  //disable the line number entry
605  } else {
608  }
609 }
610 
611 ////////////////////////////////////////////////////////////////////////////////
612 ///actions of select all/clear all button
613 
615 {
617  Bool_t sel = id ? 0 : 1;
618 
619  TGLBEntry *ent = 0;
620  for (Int_t ie=0; ie<nen; ie++) {
621  if (all) {
622  fLogList->Select(ie, sel);
623  } else {
624  if ((ent = fLogList->GetEntry(ie))) {
625  if (ent->TestBit(kDefaultActive)) fLogList->Select(ie, sel);
626  }
627  }
628  }
629 }
630 
631 
632 ////////////////////////////////////////////////////////////////////////////////
633 /// Rebuild the log info for a new entered session
634 
636 {
637  // Check if we need to remake the TProofLog object
638  Bool_t sameurl = kFALSE;
639  TUrl url(fUrlText->GetText());
640  TUrl urlref(fSessionUrl.Data());
641  if (!strcmp(url.GetHostFQDN(), urlref.GetHostFQDN())) {
642  if (url.GetPort() == urlref.GetPort()) {
643  if (!strcmp(url.GetUser(), urlref.GetUser())) {
644  sameurl = kTRUE;
645  }
646  }
647  }
648  Int_t idx = 0;
649  if (sameurl) {
650  idx = fSessNum->GetIntNumber();
651  if (idx == fSessionIdx) {
652  Info("Rebuild", "same parameters {%s, %s}, {%d, %d}: no need to rebuild TProofLog",
653  url.GetUrl(), urlref.GetUrl(), idx, fSessionIdx);
654  return;
655  }
656  }
657  // Cleanup current TProofLog
658  if (fProofLog) {
659  delete fProofLog;
660  fProofLog = nullptr;
661  }
662 
663  // Set new parameters
665  fSessionIdx = idx;
666 
667  // Rebuild the list now
669 
670  // Select the default actives to start with
671  Select(0, kFALSE);
672  // Redraw
673  fLogList->Layout();
674 
675  // Done
676  return;
677 }
TProofProgressDialog::kRunning
@ kRunning
Definition: TProofProgressDialog.h:39
TGButton::SetToolTipText
virtual void SetToolTipText(const char *text, Long_t delayms=400)
Set tool tip text associated with this button.
Definition: TGButton.cxx:445
TGNumberFormat::kNELLimitMax
@ kNELLimitMax
Upper limit only.
Definition: TGNumberEntry.h:49
TGTextButton::SetTextColor
virtual void SetTextColor(Pixel_t color, Bool_t global=kFALSE)
Changes text color.
Definition: TGButton.cxx:918
TGListBox
A listbox is a box, possibly with scrollbar, containing entries.
Definition: TGListBox.h:221
TProofProgressLog::fFullText
Bool_t fFullText
Definition: TProofProgressLog.h:62
TGTransientFrame
Defines transient windows that typically are used for dialogs windows.
Definition: TGFrame.h:498
TGButton::SetEnabled
virtual void SetEnabled(Bool_t e=kTRUE)
Set enabled or disabled state of button.
Definition: TGButton.cxx:459
TPMERegexp
Wrapper for PCRE library (Perl Compatible Regular Expressions).
Definition: TPRegexp.h:97
TQObject::Disconnect
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
Definition: TQObject.cxx:1027
TGWindow
ROOT GUI Window base class.
Definition: TGWindow.h:23
TProofProgressLog::fUrlButton
TGTextButton * fUrlButton
Definition: TProofProgressLog.h:53
TGCheckButton::SetState
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set check button state.
Definition: TGButton.cxx:1250
TProofProgressLog::fLinesFrom
TGNumberEntry * fLinesFrom
Definition: TProofProgressLog.h:45
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:100
TGTextEntry::SetText
virtual void SetText(const char *text, Bool_t emit=kTRUE)
Sets text entry to text, clears the selection and moves the cursor to the end of the line.
Definition: TGTextEntry.cxx:611
TObject::TestBit
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition: TObject.h:187
TGDimension
Definition: TGDimension.h:18
TGFrame::SetBackgroundColor
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
Definition: TGFrame.cxx:312
Option_t
const char Option_t
Definition: RtypesCore.h:66
TProofLog::LogToBox
Bool_t LogToBox()
Definition: TProofLog.h:71
TGMainFrame::SetIconName
void SetIconName(const char *name)
Set window icon name. This is typically done via the window manager.
Definition: TGFrame.cxx:1777
kNPOS
const Ssiz_t kNPOS
Definition: RtypesCore.h:124
TProofProgressLog::fAllLines
TGCheckButton * fAllLines
Definition: TProofProgressLog.h:54
TString::Prepend
TString & Prepend(const char *cs)
Definition: TString.h:661
TProofProgressLog.h
TProofProgressLog::CloseWindow
void CloseWindow()
Handle close button or when closed via window manager action.
Definition: TProofProgressLog.cxx:310
TGNumberEntry::SetIntNumber
virtual void SetIntNumber(Long_t val)
Definition: TGNumberEntry.h:180
TProofProgressLog::fGrepCheckCmd
TGCheckButton * fGrepCheckCmd
Definition: TProofProgressLog.h:59
kButtonDown
@ kButtonDown
Definition: TGButton.h:54
TProofProgressLog::fSave
TGTextButton * fSave
Definition: TProofProgressLog.h:51
TString::Data
const char * Data() const
Definition: TString.h:369
kLHintsTop
@ kLHintsTop
Definition: TGLayout.h:27
TProofLogElem::IsWorker
Bool_t IsWorker() const
Definition: TProofLog.h:105
TProofProgressDialog
This class provides a query progress bar.
Definition: TProofProgressDialog.h:33
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TNamed::GetTitle
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:48
TProofProgressLog::fLinesTo
TGNumberEntry * fLinesTo
Definition: TProofProgressLog.h:46
TGCheckButton::IsOn
virtual Bool_t IsOn() const
Definition: TGButton.h:311
TProofProgressLog::LoadFile
void LoadFile(const char *file)
Load a file in the window.
Definition: TProofProgressLog.cxx:289
TGListBox::SetMultipleSelections
virtual void SetMultipleSelections(Bool_t multi=kTRUE)
Definition: TGListBox.h:259
kLHintsLeft
@ kLHintsLeft
Definition: TGLayout.h:24
TObject::Info
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition: TObject.cxx:867
TGTextEntry::SetToolTipText
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
Definition: TGTextEntry.cxx:1649
TGLabel
This class handles GUI labels.
Definition: TGLabel.h:24
TProofProgressLog::fGrepLabel
TGLabel * fGrepLabel
Definition: TProofProgressLog.h:58
TGListBox::Resize
virtual void Resize(UInt_t w, UInt_t h)
Resize the listbox widget.
Definition: TGListBox.cxx:1411
kButtonUp
@ kButtonUp
Definition: TGButton.h:53
TUrl::GetPort
Int_t GetPort() const
Definition: TUrl.h:78
TProofProgressLog::fGrepCheckInv
TGCheckButton * fGrepCheckInv
Definition: TProofProgressLog.h:60
TGTextButton
Yield an action as soon as it is clicked.
Definition: TGButton.h:142
TProofProgressLog::fGrepButton
TGTextButton * fGrepButton
Definition: TProofProgressLog.h:52
TDatime::AsString
const char * AsString() const
Return the date & time as a string (ctime() format).
Definition: TDatime.cxx:102
SafeDelete
#define SafeDelete(p)
Definition: RConfig.hxx:536
TProofProgressLog::LogMessage
void LogMessage(const char *msg, Bool_t all)
Load/append a log msg in the log frame, if open.
Definition: TProofProgressLog.cxx:519
TProofLog::Retrieve
Int_t Retrieve(const char *ord="*", TProofLog::ERetrieveOpt opt=TProofLog::kTrailing, const char *fname=0, const char *pattern=0)
Retrieve the content of the log file associated with worker 'ord'.
Definition: TProofLog.cxx:87
TProofMgr::IsValid
virtual Bool_t IsValid() const
Definition: TProofMgr.h:77
TGText
A TGText is a multi line text buffer.
Definition: TGText.h:57
TGMainFrame::SetWindowName
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition: TGFrame.cxx:1764
TGHorizontalFrame
A composite frame that layout their children in horizontal way.
Definition: TGFrame.h:386
TGNumberEntry::GetNumberEntry
TGNumberEntryField * GetNumberEntry() const
Definition: TGNumberEntry.h:260
TString::Format
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition: TString.cxx:2333
TProofMgr
The PROOF manager interacts with the PROOF server coordinator to create or destroy a PROOF session,...
Definition: TProofMgr.h:43
TProofProgressLog::~TProofProgressLog
virtual ~TProofProgressLog()
Destructor.
Definition: TProofProgressLog.cxx:247
TString
Basic string class.
Definition: TString.h:136
TGFrame
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition: TGFrame.h:80
TProofProgressLog::kGrep
@ kGrep
Definition: TProofProgressLog.h:34
TProofProgressLog::DoLog
void DoLog(Bool_t grep=kFALSE)
Display logs.
Definition: TProofProgressLog.cxx:388
TGLabel::SetText
virtual void SetText(TGString *newText)
Set new text in label.
Definition: TGLabel.cxx:180
TPMERegexp::Substitute
Int_t Substitute(TString &s, const TString &r, Bool_t doDollarSubst=kTRUE)
Substitute matching part of s with r, dollar back-ref substitution is performed if doDollarSubst is t...
Definition: TPRegexp.cxx:872
TGFrame::MapWindow
virtual void MapWindow()
map window
Definition: TGFrame.h:204
bool
TProofLog::Save
Int_t Save(const char *ord="*", const char *fname=0, Option_t *opt="w")
Save the content associated with worker 'ord' to finel 'fname'.
Definition: TProofLog.cxx:201
TProofProgressLog::Popup
void Popup()
Show log window.
Definition: TProofProgressLog.cxx:263
TGCheckButton::SetDisabledAndSelected
virtual void SetDisabledAndSelected(Bool_t)
Set the state of a check button to disabled and either on or off.
Definition: TGButton.cxx:1310
TProofProgressLog::NoLineEntry
void NoLineEntry()
Enable/disable the line number entry.
Definition: TProofProgressLog.cxx:599
TGTextEntry::SetDefaultSize
virtual void SetDefaultSize(UInt_t w, UInt_t h)
Set the default / minimal size of the widget.
Definition: TGTextEntry.cxx:384
TString::kBoth
@ kBoth
Definition: TString.h:267
TProofProgressDialog::fStatus
EQueryStatus fStatus
Definition: TProofProgressDialog.h:77
TGListBox::Layout
virtual void Layout()
Layout the listbox components.
Definition: TGListBox.cxx:1452
gClient
#define gClient
Definition: TGClient.h:157
kLHintsBottom
@ kLHintsBottom
Definition: TGLayout.h:29
TGCheckButton
Selects different options.
Definition: TGButton.h:264
retrieve
static void retrieve(const gsl_integration_workspace *workspace, double *a, double *b, double *r, double *e)
Definition: RooAdaptiveGaussKronrodIntegrator1D.cxx:707
TProofLog::kTrailing
@ kTrailing
Definition: TProofLog.h:51
TString::Form
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition: TString.cxx:2311
TGFrame::DeleteWindow
virtual void DeleteWindow()
Delete window.
Definition: TGFrame.cxx:276
TProof::Mgr
static TProofMgr * Mgr(const char *url)
Get instance of the effective manager for 'url' Return 0 on failure.
Definition: TProof.cxx:11720
TProofProgressLog::fLogList
TGListBox * fLogList
Definition: TProofProgressLog.h:41
TPRegexp.h
TProofProgressLog::fVworkers
TGVerticalFrame * fVworkers
Definition: TProofProgressLog.h:57
TGListBox::RemoveEntries
virtual void RemoveEntries(Int_t from_ID, Int_t to_ID)
Remove a range of entries defined by from_ID and to_ID.
Definition: TGListBox.cxx:1353
TProofProgressLog::fSessionUrl
TString fSessionUrl
Definition: TProofProgressLog.h:36
kDefaultActive
const UInt_t kDefaultActive
Definition: TProofProgressLog.cxx:26
TProofProgressLog::Clear
void Clear(Option_t *=0)
Clear log window.
Definition: TProofProgressLog.cxx:271
TProofProgressDialog::fLogWindow
TProofProgressLog * fLogWindow
Definition: TProofProgressDialog.h:67
TObject::ResetBit
void ResetBit(UInt_t f)
Definition: TObject.h:186
TProofProgressDialog::fProof
TProof * fProof
Definition: TProofProgressDialog.h:69
kLHintsCenterY
@ kLHintsCenterY
Definition: TGLayout.h:28
TGDimension::fHeight
UInt_t fHeight
Definition: TGDimension.h:21
TGTextView::Clear
virtual void Clear(Option_t *="")
Clear text view widget.
Definition: TGTextView.cxx:430
h
#define h(i)
Definition: RSha256.hxx:106
TObject::SetBit
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:696
TProofProgressLog::fSessNum
TGNumberEntry * fSessNum
Definition: TProofProgressLog.h:49
TProofLog.h
TGCompositeFrame::MapSubwindows
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1164
TGVerticalFrame
A composite frame that layout their children in vertical way.
Definition: TGFrame.h:375
TGFrame::Resize
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:605
TGTextEntry
A TGTextEntry is a one line text input widget.
Definition: TGTextEntry.h:24
TString::Remove
TString & Remove(Ssiz_t pos)
Definition: TString.h:673
TProofProgressLog::SaveToFile
void SaveToFile()
Save the logs to a file Only the name of the file is taken, no expansion.
Definition: TProofProgressLog.cxx:534
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:101
TString::Append
TString & Append(const char *cs)
Definition: TString.h:564
TProof.h
TProofProgressLog::TProofProgressLog
TProofProgressLog(TProofProgressDialog *d, Int_t w=700, Int_t h=600)
Create a window frame for log messages.
Definition: TProofProgressLog.cxx:44
TGFrame.h
TGTextView::LoadBuffer
virtual Bool_t LoadBuffer(const char *txtbuf)
Load text from a text buffer. Return false in case of failure.
Definition: TGTextView.cxx:471
kLHintsRight
@ kLHintsRight
Definition: TGLayout.h:26
TGLayoutHints
This class describes layout hints used by the layout classes.
Definition: TGLayout.h:50
TProofProgressLog::fClose
TGTextButton * fClose
Definition: TProofProgressLog.h:40
gDebug
Int_t gDebug
Definition: TROOT.cxx:590
TProofProgressDialog.h
BIT
#define BIT(n)
Definition: Rtypes.h:85
TProofProgressLog::LoadBuffer
void LoadBuffer(const char *buffer)
Load a text buffer in the window.
Definition: TProofProgressLog.cxx:280
TProofProgressLog::Init
void Init(Int_t w=700, Int_t h=600)
Init window frame for log messages.
Definition: TProofProgressLog.cxx:70
UInt_t
unsigned int UInt_t
Definition: RtypesCore.h:46
TProofProgressLog::fTextType
Int_t fTextType
Definition: TProofProgressLog.h:63
TProofProgressLog::fFileName
TGTextEntry * fFileName
Definition: TProofProgressLog.h:50
kLHintsExpandY
@ kLHintsExpandY
Definition: TGLayout.h:31
TProofProgressLog::fGrepText
TGTextEntry * fGrepText
Definition: TProofProgressLog.h:47
TProofLogElem
Definition: TProofLog.h:79
TGListBox.h
TProofLog::SetLogToBox
void SetLogToBox(Bool_t lgbox=kFALSE)
Definition: TProofLog.h:70
TProofProgressLog::fProofLog
TProofLog * fProofLog
Definition: TProofProgressLog.h:44
TProofProgressLog::fLogNew
TGTextButton * fLogNew
Definition: TProofProgressLog.h:42
TGLBEntry
Basic listbox entries.
Definition: TGListBox.h:24
TObject::Warning
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:879
TUrl::GetUrl
const char * GetUrl(Bool_t withDeflt=kFALSE) const
Return full URL.
Definition: TUrl.cxx:389
TUrl
This class represents a WWW compatible URL.
Definition: TUrl.h:33
TProofProgressLog::SetGrepView
void SetGrepView()
Sets the view of grep filters according to the value of checkboxes.
Definition: TProofProgressLog.cxx:570
TGListBox::GetEntry
virtual TGLBEntry * GetEntry(Int_t id) const
Returns list box entry with specified id.
Definition: TGListBox.cxx:1372
TString::Index
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition: TString.h:639
TGTextView.h
TProofMgr::GetSessionLogs
virtual TProofLog * GetSessionLogs(Int_t=0, const char *=0, const char *="-v \"| SvcMsg\"", Bool_t=kFALSE)
Definition: TProofMgr.h:91
TGListBox::GetNumberOfEntries
virtual Int_t GetNumberOfEntries() const
Definition: TGListBox.h:263
TGListBox::Select
virtual TGLBEntry * Select(Int_t id, Bool_t sel=kTRUE)
Definition: TGListBox.h:284
TGLabel.h
TGListBox::GetSelectedEntries
virtual void GetSelectedEntries(TList *selected)
Adds all selected entries (TGLBEntry) of the list box into the list selected.
Definition: TGListBox.cxx:1525
TProofProgressLog::BuildLogList
void BuildLogList(Bool_t create=kFALSE)
Build the list of workers.
Definition: TProofProgressLog.cxx:319
TGWindow::GetParent
const TGWindow * GetParent() const
Definition: TGWindow.h:76
TGNumberEntry::SetLimits
virtual void SetLimits(ELimit limits=TGNumberFormat::kNELNoLimits, Double_t min=0, Double_t max=1)
Definition: TGNumberEntry.h:219
TGText::LoadBuffer
Bool_t LoadBuffer(const char *txtbuf)
Load a 0 terminated buffer. Lines will be split at ' '.
Definition: TGText.cxx:513
TString::IsNull
Bool_t IsNull() const
Definition: TString.h:407
TProofLog::GetListOfLogs
TList * GetListOfLogs() const
Definition: TProofLog.h:58
TQObject::Connect
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Definition: TQObject.cxx:869
TGListBox::FindEntry
virtual TGLBEntry * FindEntry(const char *s) const
Find entry by name.
Definition: TGListBox.cxx:1635
TProofLog::StartTime
TDatime StartTime()
Definition: TProofLog.h:67
TGTransientFrame::CenterOnParent
virtual void CenterOnParent(Bool_t croot=kTRUE, EPlacement pos=kCenter)
Position transient frame centered relative to the parent frame.
Definition: TGFrame.cxx:1931
file
Definition: file.py:1
TGTextEntry::GetDefaultSize
virtual TGDimension GetDefaultSize() const
Return the default / minimal size of the widget.
Definition: TGTextEntry.cxx:374
TProofLog::Display
void Display(const char *ord="*", Int_t from=-10, Int_t to=-1)
Display the content associated with worker 'ord' from line 'from' to line 'to' inclusive.
Definition: TProofLog.cxx:131
TUrl::GetHost
const char * GetHost() const
Definition: TUrl.h:67
TGTextView
A TGTextView is a text viewer widget.
Definition: TGTextView.h:22
TGButton.h
TProofProgressLog::AddBuffer
void AddBuffer(const char *buffer)
Add text to the window.
Definition: TProofProgressLog.cxx:298
TProofProgressDialog::fSessionUrl
TString fSessionUrl
Definition: TProofProgressDialog.h:92
TGTextLBEntry
Text string listbox entries.
Definition: TGListBox.h:48
kDeepCleanup
@ kDeepCleanup
Definition: TGFrame.h:42
d
#define d(i)
Definition: RSha256.hxx:102
TGTextEntry::GetText
const char * GetText() const
Definition: TGTextEntry.h:119
TGString::GetString
const char * GetString() const
Definition: TGString.h:30
TProofProgressLog::Select
void Select(Int_t id, Bool_t all=kTRUE)
actions of select all/clear all button
Definition: TProofProgressLog.cxx:614
TGNumberEntry::GetIntNumber
virtual Long_t GetIntNumber() const
Definition: TGNumberEntry.h:200
TIter
Definition: TCollection.h:233
TProofProgressLog::fSessionIdx
Int_t fSessionIdx
Definition: TProofProgressLog.h:37
TGNumberEntry.h
kLHintsExpandX
@ kLHintsExpandX
Definition: TGLayout.h:30
TGCompositeFrame::SetCleanup
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition: TGFrame.cxx:1072
TProofProgressLog::Rebuild
void Rebuild()
Rebuild the log info for a new entered session.
Definition: TProofProgressLog.cxx:635
TGNumberEntry
TGNumberEntry is a number entry input widget with up/down buttons.
Definition: TGNumberEntry.h:148
TProofProgressLog::kStd
@ kStd
Definition: TProofProgressLog.h:34
TNamed::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
TGFrame::Layout
virtual void Layout()
Definition: TGFrame.h:199
TGListBox::AddEntry
virtual void AddEntry(TGString *s, Int_t id)
Add entry with specified string and id to listbox.
Definition: TGListBox.cxx:1203
TProofProgressLog
Dialog used to display Proof session logs from the Proof progress dialog.
Definition: TProofProgressLog.h:31
TProofProgressLog::fRawLines
TGCheckButton * fRawLines
Definition: TProofProgressLog.h:55
TProofProgressLog::kRaw
@ kRaw
Definition: TProofProgressLog.h:34
TUrl::GetUser
const char * GetUser() const
Definition: TUrl.h:65
TGNumberEntry::SetState
virtual void SetState(Bool_t enable=kTRUE)
Set the active state.
Definition: TGNumberEntry.cxx:2026
TGCompositeFrame::AddFrame
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1117
TProofProgressLog::fUrlText
TGTextEntry * fUrlText
Definition: TProofProgressLog.h:48
TUrl::GetHostFQDN
const char * GetHostFQDN() const
Return fully qualified domain name of url host.
Definition: TUrl.cxx:471
kLogElemFilled
const UInt_t kLogElemFilled
Definition: TProofProgressLog.cxx:25
TGNumberFormat::kNESInteger
@ kNESInteger
Style of number entry field.
Definition: TGNumberEntry.h:25
TList
A doubly linked list.
Definition: TList.h:44
TGTextView::LoadFile
virtual Bool_t LoadFile(const char *fname, long startpos=0, long length=-1)
Load a file in the text view widget.
Definition: TGTextView.cxx:454
TProofProgressLog::fDialog
TProofProgressDialog * fDialog
Definition: TProofProgressLog.h:43
TGTextView::AddText
virtual void AddText(TGText *text)
Add text to the view widget.
Definition: TGTextView.cxx:208
TProofProgressLog::fText
TGTextView * fText
Definition: TProofProgressLog.h:39
int
TGTextLBEntry::GetText
const TGString * GetText() const
Definition: TGListBox.h:79
TError.h
TProofLog::kGrep
@ kGrep
Definition: TProofLog.h:52