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 // //
30 // TProofProgressLog //
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 
39 
40 ////////////////////////////////////////////////////////////////////////////////
41 /// Create a window frame for log messages.
42 
44  TGTransientFrame(gClient->GetRoot(), gClient->GetRoot(), w, h)
45 {
46  fDialog = d;
48  fSessionIdx = 0;
49 
50  Init(w, h);
51 }
52 
53 ////////////////////////////////////////////////////////////////////////////////
54 /// Create a window frame for log messages.
55 
57  TGTransientFrame(gClient->GetRoot(), gClient->GetRoot(), w, h)
58 {
59  fDialog = 0;
60  fSessionUrl = url;
61  fSessionIdx = (idx > 0) ? -idx : idx;
62 
63  Init(w, h);
64 }
65 
66 ////////////////////////////////////////////////////////////////////////////////
67 /// Init window frame for log messages.
68 
70 {
71  fProofLog = 0;
72  fFullText = kFALSE;
73  fTextType = kStd;
74  // use hierarchical cleaning
76 
77  //The text window
78  TGHorizontalFrame *htotal = new TGHorizontalFrame(this, w, h);
79  TGVerticalFrame *vtextbox = new TGVerticalFrame(htotal, w, h);
80  //fText = new TGTextView(this, w, h);
81  fText = new TGTextView(vtextbox, w, h);
82  vtextbox->AddFrame(fText, new TGLayoutHints(kLHintsTop | kLHintsExpandX | kLHintsExpandY, 3, 3, 3, 3));
83 
84  //The frame for choosing workers
85  fVworkers = new TGVerticalFrame(htotal);
86  // URL choice
87  TGLabel *laburl = new TGLabel(fVworkers, "Enter cluster URL:");
88  fVworkers->AddFrame(laburl, new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 2, 2, 2));
92  //The lower row of number entries and buttons
93  TGHorizontalFrame *hfurlbox = new TGHorizontalFrame(fVworkers, 20, 20);
94  TGLabel *labsess = new TGLabel(hfurlbox, "Enter session:");
95  hfurlbox->AddFrame(labsess, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 5, 2, 2, 2));
96  fSessNum = new TGNumberEntry(hfurlbox, 0, 5, -1, TGNumberFormat::kNESInteger);
99  fSessNum->GetNumberEntry()->SetToolTipText("Use 0 for the last known one,"
100  " negative numbers for the previous ones, e.g. -1 for the last-but-one");
101  hfurlbox->AddFrame(fSessNum, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 2, 0, 0, 0));
102  fUrlButton = new TGTextButton(hfurlbox, "Get logs info");
103  fUrlButton->Connect("Clicked()", "TProofProgressLog", this, "Rebuild()");
104  hfurlbox->AddFrame(fUrlButton, new TGLayoutHints(kLHintsCenterY | kLHintsRight, 4, 0, 0, 0));
105  fVworkers->AddFrame(hfurlbox, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX, 2, 2, 2, 2));
106 
107  TGNumberEntry *nent = new TGNumberEntry(hfurlbox);
108  fVworkers->AddFrame(nent, new TGLayoutHints(kLHintsTop | kLHintsLeft, 4, 0, 0, 0));
109 
110  //The list of workers
111  fLogList = 0;
113  fLogList->Resize(102,52);
115 
116  //The SelectAll/ClearAll buttons
117  TGHorizontalFrame *hfselbox = new TGHorizontalFrame(fVworkers, 20, 20);
118  TGLabel *label1 = new TGLabel(hfselbox,"Choose workers:");
119  hfselbox->AddFrame(label1, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 0, 0, 0, 0));
120  TGTextButton *selall = new TGTextButton(hfselbox, " &All ");
121  selall->Connect("Clicked()", "TProofProgressLog", this, "Select(=0)");
122  hfselbox->AddFrame(selall, new TGLayoutHints(kLHintsCenterY | kLHintsRight, 10, 0, 0, 0));
123  TGTextButton *clearall = new TGTextButton(hfselbox, " &Clear ");
124  clearall->Connect("Clicked()", "TProofProgressLog", this, "Select(=1)");
125  hfselbox->AddFrame(clearall, new TGLayoutHints(kLHintsCenterY | kLHintsRight, 10, 0, 0, 0));
126 
127  //select the defaut actives to start with
128  Select(0, kFALSE);
129 
130  //Display button
131  fLogNew = new TGTextButton(fVworkers, "&Display");
132  fLogNew->Connect("Clicked()", "TProofProgressLog", this, "DoLog(=kFALSE)");
133  //fLogNew->Resize(102, 20);
134  // fLogNew->SetMargins(1, 1, 0, 1);
135  fLogNew->SetTextColor(0xffffff, kFALSE);
136  fLogNew->SetBackgroundColor(0x000044);
137  fVworkers->AddFrame(hfselbox, new TGLayoutHints(kLHintsExpandX | kLHintsTop, 5, 2, 2, 2));
140 
142 
143  //The lower row of number entries and buttons
144  TGHorizontalFrame *hflogbox = new TGHorizontalFrame(vtextbox, 550, 20);
145  fClose = new TGTextButton(hflogbox, " &Close ");
146  fClose->Connect("Clicked()", "TProofProgressLog", this, "CloseWindow()");
148  kLHintsRight, 10, 2, 2, 2));
149 
150  //Saving to a file controls
151  fSave = new TGTextButton(hflogbox, "&Save");
152  fSave->Connect("Clicked()", "TProofProgressLog", this, "SaveToFile()");
153  hflogbox->AddFrame(fSave, new TGLayoutHints(kLHintsCenterY | kLHintsRight, 4, 0, 0, 0));
154  fFileName = new TGTextEntry(hflogbox);
155  fFileName->SetText("<session-tag>.log");
157  TGLabel *label10 = new TGLabel(hflogbox, "Save to a file:");
158  hflogbox->AddFrame(label10, new TGLayoutHints(kLHintsCenterY | kLHintsRight, 50, 2, 2, 2));
159 
160  //Choose the number of lines to display
161  TGVerticalFrame *vlines = new TGVerticalFrame(hflogbox);
162  TGHorizontalFrame *vlines_buttons = new TGHorizontalFrame(vlines);
163  TGLabel *label2 = new TGLabel(vlines_buttons, "Lines:");
164  vlines_buttons->AddFrame(label2, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 2, 2, 2, 2));
165 
166  fAllLines = new TGCheckButton(vlines_buttons, "all");
167  fAllLines->SetToolTipText("Retrieve all lines (service messages excluded)");
169  fAllLines->Connect("Clicked()", "TProofProgressLog", this, "NoLineEntry()");
170  vlines_buttons->AddFrame(fAllLines, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 2, 2, 2, 2));
171 
172  fRawLines = new TGCheckButton(vlines_buttons, "svcmsg");
173  fRawLines->SetToolTipText("Retrieve all type of lines, service messages included");
175  vlines_buttons->AddFrame(fRawLines, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 2, 2, 2, 2));
176 
177  TGLabel *label11 = new TGLabel(vlines_buttons, "From");
178  vlines_buttons->AddFrame(label11, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 2, 2, 2, 2));
179 
180  fLinesFrom = new TGNumberEntry(vlines_buttons, 0, 5, -1, TGNumberFormat::kNESInteger);
181  // coverity[negative_returns]: no problem with -100, the format is kNESInteger
182  fLinesFrom->SetIntNumber(-100);
183  fLinesFrom->GetNumberEntry()->SetToolTipText("Negative values indicate \"tail\" action");
184 
185 
186  vlines_buttons->AddFrame(fLinesFrom, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 2, 2, 2, 2));
187 
188  TGLabel *label3 = new TGLabel(vlines_buttons, "to");
189  vlines_buttons->AddFrame(label3, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 2, 2, 2, 2));
190  fLinesTo = new TGNumberEntry(vlines_buttons, 0, 5, -1, TGNumberFormat::kNESInteger);
191  vlines_buttons->AddFrame(fLinesTo, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 2, 2, 2, 2));
192  vlines->AddFrame(vlines_buttons, new TGLayoutHints(kLHintsCenterY));
193  hflogbox->AddFrame(vlines, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 2, 2, 2, 2));
194 
195  //
196  // Lowest line, with filter (grep or cmd pipe) controls
197  //
198 
199  TGHorizontalFrame *hfgrepbox = new TGHorizontalFrame(vtextbox, 550, 20);
200 
201  // Grep/pipe label, textbox and button
202  fGrepLabel = new TGLabel(hfgrepbox, "");
203  hfgrepbox->AddFrame(fGrepLabel, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 2, 2, 2, 2));
204  fGrepText = new TGTextEntry(hfgrepbox);
205  {
207  fGrepText->SetDefaultSize(400, dim.fHeight);
208  }
210  fGrepButton = new TGTextButton(hfgrepbox, "Filter");
211  fGrepButton->Connect("Clicked()", "TProofProgressLog", this, "DoLog(=kTRUE)");
212  hfgrepbox->AddFrame(fGrepButton, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 4, 10, 0, 0)); // l r t b
213 
214  // Checkbox for inverting selection or giving a pipe command
215  fGrepCheckInv = new TGCheckButton(hfgrepbox, "invert match");
216  fGrepCheckInv->Connect("Clicked()", "TProofProgressLog", this, "SetGrepView()");
217  hfgrepbox->AddFrame(fGrepCheckInv, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 2, 2, 2, 2));
218 
219  fGrepCheckCmd = new TGCheckButton(hfgrepbox, "is a pipe command");
220  fGrepCheckCmd->Connect("Clicked()", "TProofProgressLog", this, "SetGrepView()");
221  hfgrepbox->AddFrame(fGrepCheckCmd, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 2, 2, 2, 2));
222 
223  // fRawLines->SetToolTipText("Retrieve all type of lines, service messages included");
224  // fRawLines->SetState(kButtonUp);
225  // vlines_buttons->AddFrame(fRawLines, new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 2, 2, 2, 2));
226 
227  //
228  // Add frames to the global picture
229  //
230 
231  vtextbox->AddFrame(hflogbox, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX, 2, 2, 2, 2));
232  vtextbox->AddFrame(hfgrepbox, new TGLayoutHints(kLHintsBottom | kLHintsLeft | kLHintsExpandX, 2, 2, 2, 2));
233  htotal->AddFrame(vtextbox, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY | kLHintsRight, 3, 3, 3, 3));
235  kLHintsExpandY, 3, 3, 3, 3));
236  SetGrepView();
237  MapSubwindows();
238  Resize();
239  CenterOnParent();
240  Popup();
241 }
242 
243 ////////////////////////////////////////////////////////////////////////////////
244 /// Destructor
245 
247 {
248  // Cleanup the log object
250 
251  // Detach from owner dialog
252  if (fDialog) {
253  fDialog->fLogWindow = 0;
254  fDialog->fProof->Disconnect("LogMessage(const char*,Bool_t)", this,
255  "LogMessage(const char*,Bool_t)");
256  }
257 }
258 
259 ////////////////////////////////////////////////////////////////////////////////
260 /// Show log window.
261 
263 {
264  MapWindow();
265 }
266 
267 ////////////////////////////////////////////////////////////////////////////////
268 /// Clear log window.
269 
271 {
272  if (fText)
273  fText->Clear();
274 }
275 
276 ////////////////////////////////////////////////////////////////////////////////
277 /// Load a text buffer in the window.
278 
279 void TProofProgressLog::LoadBuffer(const char *buffer)
280 {
281  if (fText)
282  fText->LoadBuffer(buffer);
283 }
284 
285 ////////////////////////////////////////////////////////////////////////////////
286 /// Load a file in the window.
287 
289 {
290  if (fText)
291  fText->LoadFile(file);
292 }
293 
294 ////////////////////////////////////////////////////////////////////////////////
295 /// Add text to the window.
296 
297 void TProofProgressLog::AddBuffer(const char *buffer)
298 {
299  if (fText) {
300  TGText txt;
301  txt.LoadBuffer(buffer);
302  fText->AddText(&txt);
303  }
304 }
305 
306 ////////////////////////////////////////////////////////////////////////////////
307 /// Handle close button or when closed via window manager action.
308 
310 {
311  DeleteWindow();
312 }
313 
314 ////////////////////////////////////////////////////////////////////////////////
315 /// Build the list of workers. For this, extract the logs and take the names
316 /// of TProofLogElements
317 
319 {
320  // Set title
321  TString title;
322  title.Form("PROOF - Processing logs for session 'undefined'");
323  SetWindowName(title.Data());
324  SetIconName(title.Data());
325 
326  // Create the list-box now
327  if (create) {
328  if (fLogList) delete fLogList;
330  } else {
331  // Reset
333  fLogList->RemoveEntries(0,nent);
334  fLogList->Layout();
335  }
336 
337  if (fSessionUrl.IsNull()) {
338  if (gDebug > 0)
339  Info("BuildLogList", "sesssion URL undefined - do nothing");
340  return;
341  }
343  if (!mgr || !mgr->IsValid()) {
344  Warning("BuildLogList", "unable open a manager connection to %s",
345  fSessionUrl.Data());
346  return;
347  }
348  if (!(fProofLog = mgr->GetSessionLogs(fSessionIdx,"NR"))) {
349  Warning("BuildLogList", "unable to get logs from %s",
350  fSessionUrl.Data());
351  return;
352  }
353  // Set title
354  title.Form("PROOF - Processing logs for session '%s', started on %s at %s",
356  fProofLog->GetTitle());
357  SetWindowName(title.Data());
358  SetIconName(title.Data());
359 
360  TList *elem = fProofLog->GetListOfLogs();
361  TIter next(elem);
362  TProofLogElem *pe = 0;
363 
364  Int_t is = 0;
365  TGLBEntry *ent = 0;
366  TString buf;
367  while ((pe=(TProofLogElem*)next())){
368  TUrl url(pe->GetTitle());
369  buf.Form("%s %s", pe->GetName(), url.GetHost());
370  fLogList->AddEntry(buf.Data(), is);
371  if ((ent = fLogList->FindEntry(buf.Data()))) {
372  ent->ResetBit(kLogElemFilled);
373  ent->ResetBit(kDefaultActive);
374  if (!(pe->IsWorker())) ent->SetBit(kDefaultActive);
375  }
376  is++;
377  }
378 
379  // Done
380  return;
381 }
382 
383 ////////////////////////////////////////////////////////////////////////////////
384 /// Display logs. 'grep' is set to kTRUE if it is invoked by pressing the
385 /// 'Filter' button.
386 
388 {
389  Clear();
390 
391  if (!fGrepText) {
392  Warning("DoLog", "no text: do nothing!");
393  return;
394  }
395 
396  TString greptext = fGrepText->GetText();
397  greptext.Remove(TString::kBoth, ' ');
398  if (greptext.IsNull()) {
399  grep = kFALSE;
400  }
401  else if (!fGrepCheckCmd->IsOn()) {
402  // Not a command: sanitize string
403  TPMERegexp san("(^|[^\\\\])([^a-zA-Z0-9_=\\\\/.-])");
404  while ( san.Substitute(greptext, "$1\\$2") > 0 );
405  }
406 
407  Int_t from, to;
408  if (fAllLines->IsOn()){
409  from = 0;
410  to = -1;
411  } else {
412  from = fLinesFrom->GetIntNumber();
413  to = fLinesTo->GetIntNumber();
414  }
415 
416  // Create the TProofLog instance
417  if (!fProofLog) {
418  TProofMgr *mgr = 0;
419  if ((mgr = TProof::Mgr(fSessionUrl.Data()))) {
420  if (!(fProofLog = mgr->GetSessionLogs(fSessionIdx, "NR"))) {
421  Warning("DoLog", "unable to instantiate TProofLog for %s",
422  fSessionUrl.Data());
423  }
424  } else {
425  Warning("DoLog", "unable to instantiate a TProofMgr for %s",
426  fSessionUrl.Data());
427  }
428  }
429 
430  // Pipe command for filtering
431  TString pipeCommand;
432 
433  // Filter out SvcMsg
434  if (!fRawLines->IsOn()) {
435  pipeCommand = "grep -v \"| SvcMsg\"";
436  }
437 
438  // Default is not retrieving
440  if (!grep) {
441  // Not invoked via 'Filter' button
442  if (!fFullText ||
443  ((fTextType != kRaw && fRawLines->IsOn()) ||
444  (fTextType != kStd && !fRawLines->IsOn())) ||
446  retrieve = kTRUE;
447  if (fRawLines->IsOn()) {
448  fTextType = kRaw;
449  } else {
450  fTextType = kStd;
451  }
453  fFullText = kTRUE;
454  }
455  } else {
456  retrieve = kTRUE;
457  fTextType = kGrep;
458 
459  if (!pipeCommand.IsNull())
460  pipeCommand.Append('|');
461 
462  if (fGrepCheckCmd->IsOn()) {
463  pipeCommand.Append(greptext);
464  }
465  else {
466  pipeCommand.Append("grep ");
467  if (fGrepCheckInv->IsOn())
468  pipeCommand.Append("-v ");
469  pipeCommand.Append("-- ");
470  pipeCommand.Append(greptext); // sanitized
471  }
472 
474  fFullText = kTRUE;
475  }
476 
477  // Display now
478  if (fProofLog) {
479  TList *selected = new TList;
480  fLogList->GetSelectedEntries(selected);
481  TIter next(selected);
482  TGTextLBEntry *selentry;
483  Bool_t logonly = fProofLog->LogToBox();
485 
486  fProofLog->Connect("Prt(const char*)", "TProofProgressLog",
487  this, "LogMessage(const char*, Bool_t)");
488  while ((selentry=(TGTextLBEntry*)next())){
489  TString ord = selentry->GetText()->GetString();
490  Int_t is = ord.Index(" ");
491  if (is != kNPOS) ord.Remove(is);
492  if (retrieve || !selentry->TestBit(kLogElemFilled)) {
493  pipeCommand.Prepend('|');
494  if (fTextType == kRaw) {
495  if (gDebug >= 2)
496  Info("DoLog", "Retrieving unfiltered log for %s", ord.Data());
498  }
499  else {
500  if (gDebug >= 2)
501  Info("DoLog", "Retrieving log for %s filtered with %s",
502  ord.Data(), pipeCommand.Data());
503  fProofLog->Retrieve(ord.Data(), TProofLog::kGrep, 0, pipeCommand.Data());
504  }
505  selentry->SetBit(kLogElemFilled);
506  }
507  fProofLog->Display(ord.Data(), from, to);
508  }
509  fProofLog->SetLogToBox(logonly);
510  fProofLog->Disconnect("Prt(const char*)", this, "LogMessage(const char*, Bool_t)");
511  delete selected;
512  }
513 }
514 
515 ////////////////////////////////////////////////////////////////////////////////
516 /// Load/append a log msg in the log frame, if open
517 
518 void TProofProgressLog::LogMessage(const char *msg, Bool_t all)
519 {
520  if (all) {
521  // load buffer
522  LoadBuffer(msg);
523  } else {
524  // append
525  AddBuffer(msg);
526  }
527 }
528 
529 ////////////////////////////////////////////////////////////////////////////////
530 ///Save the logs to a file
531 ///Only the name of the file is taken, no expansion
532 
534 {
535  if (!fProofLog) DoLog();
536 
537  // File name: the default is <session-tag>.log
538  TString filename = fFileName->GetText();
539  if (filename.IsNull() || filename == "<session-tag>.log") {
540  filename = (fDialog && fDialog->fProof) ?
541  TString::Format("%s.log", fDialog->fProof->GetName()) :
542  TString("proof.log");
543  }
544 
545  TList *selected = new TList;
546  fLogList->GetSelectedEntries(selected);
547  TIter next(selected);
548  TGTextLBEntry *selentry;
549  Bool_t writemode=kTRUE;
550  const char *option;
551  TString ord;
552  while ((selentry=(TGTextLBEntry*)next())){
553  ord = selentry->GetText()->GetString();
554  Int_t isp = ord.Index(' ');
555  if (isp != kNPOS) ord.Remove(isp);
556  //open the file in "w" mode for the first time
557  option = writemode ? "w" : "a";
558  fProofLog->Save(ord.Data(), filename.Data(), option);
559  writemode=kFALSE;
560  }
561  delete selected;
562 
563  Info("SaveToFile", "logs saved to file %s", filename.Data());
564 }
565 
566 ////////////////////////////////////////////////////////////////////////////////
567 /// Sets the view of grep filters according to the value of checkboxes
568 
570 {
571  if (fGrepCheckCmd->IsOn()) {
572  fGrepLabel->SetText("Pipe log through command:");
574  }
575  else {
576  fGrepLabel->SetText("Grep:");
577  Bool_t u = fGrepCheckInv->IsOn();
579  if (u) {
580  fGrepLabel->SetText("Show lines not matching:");
582  }
583  else {
584  fGrepLabel->SetText("Show lines matching:");
586  }
587  }
588 
589  // Ugly but necessary const_cast
590  TGFrame *frame = dynamic_cast<TGFrame *>( const_cast<TGWindow *>(fGrepLabel->GetParent()) );
591  if (frame) frame->Layout();
592 
593 }
594 
595 ////////////////////////////////////////////////////////////////////////////////
596 ///Enable/disable the line number entry
597 
599 {
600  if (fAllLines->IsOn()){
601  //disable the line number entry
604  } else {
607  }
608 }
609 
610 ////////////////////////////////////////////////////////////////////////////////
611 ///actions of select all/clear all button
612 
614 {
616  Bool_t sel = id ? 0 : 1;
617 
618  TGLBEntry *ent = 0;
619  for (Int_t ie=0; ie<nen; ie++) {
620  if (all) {
621  fLogList->Select(ie, sel);
622  } else {
623  if ((ent = fLogList->GetEntry(ie))) {
624  if (ent->TestBit(kDefaultActive)) fLogList->Select(ie, sel);
625  }
626  }
627  }
628 }
629 
630 
631 ////////////////////////////////////////////////////////////////////////////////
632 /// Rebuild the log info for a new entered session
633 
635 {
636  // Check if we need to remake the TProofLog object
637  Bool_t sameurl = kFALSE;
638  TUrl url(fUrlText->GetText());
639  TUrl urlref(fSessionUrl.Data());
640  if (!strcmp(url.GetHostFQDN(), urlref.GetHostFQDN())) {
641  if (url.GetPort() == urlref.GetPort()) {
642  if (!strcmp(url.GetUser(), urlref.GetUser())) {
643  sameurl = kTRUE;
644  }
645  }
646  }
647  Int_t idx = 0;
648  if (sameurl) {
649  idx = fSessNum->GetIntNumber();
650  if (idx == fSessionIdx) {
651  Info("Rebuild", "same paremeters {%s, %s}, {%d, %d}: no need to rebuild TProofLog",
652  url.GetUrl(), urlref.GetUrl(), idx, fSessionIdx);
653  return;
654  }
655  }
656  // Cleanup current TProofLog
657  if (fProofLog) delete fProofLog;
658 
659  // Set new parameters
661  fSessionIdx = idx;
662 
663  // Rebuild the list now
665 
666  // Select the defaut actives to start with
667  Select(0, kFALSE);
668  // Redraw
669  fLogList->Layout();
670 
671  // Done
672  return;
673 }
TProofProgressDialog::kRunning
@ kRunning
Definition: TProofProgressDialog.h:47
TGButton::SetToolTipText
virtual void SetToolTipText(const char *text, Long_t delayms=400)
Set tool tip text associated with this button.
Definition: TGButton.cxx:398
TGNumberFormat::kNELLimitMax
@ kNELLimitMax
Definition: TGNumberEntry.h:58
TGTextButton::SetTextColor
virtual void SetTextColor(Pixel_t color, Bool_t global=kFALSE)
Changes text color.
Definition: TGButton.cxx:871
TGListBox
Definition: TGListBox.h:288
TProofProgressLog::fFullText
Bool_t fFullText
Definition: TProofProgressLog.h:71
TGTransientFrame
Definition: TGFrame.h:553
TGButton::SetEnabled
virtual void SetEnabled(Bool_t e=kTRUE)
Set enabled or disabled state of button.
Definition: TGButton.cxx:412
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:1022
TGWindow
Definition: TGWindow.h:31
TProofProgressLog::fUrlButton
TGTextButton * fUrlButton
Definition: TProofProgressLog.h:62
TGCheckButton::SetState
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set check button state.
Definition: TGButton.cxx:1203
TProofProgressLog::fLinesFrom
TGNumberEntry * fLinesFrom
Definition: TProofProgressLog.h:54
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
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:623
TObject::TestBit
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition: TObject.h:172
TGDimension
Definition: TGDimension.h:27
TGFrame::SetBackgroundColor
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
Definition: TGFrame.cxx:297
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:1762
kNPOS
const Ssiz_t kNPOS
Definition: RtypesCore.h:115
TProofProgressLog::fAllLines
TGCheckButton * fAllLines
Definition: TProofProgressLog.h:63
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:309
TGNumberEntry::SetIntNumber
virtual void SetIntNumber(Long_t val)
Definition: TGNumberEntry.h:189
TProofProgressLog::fGrepCheckCmd
TGCheckButton * fGrepCheckCmd
Definition: TProofProgressLog.h:68
kButtonDown
@ kButtonDown
Definition: TGButton.h:54
TProofProgressLog::fSave
TGTextButton * fSave
Definition: TProofProgressLog.h:60
TString::Data
const char * Data() const
Definition: TString.h:369
kLHintsTop
@ kLHintsTop
Definition: TGLayout.h:34
TProofLogElem::IsWorker
Bool_t IsWorker() const
Definition: TProofLog.h:105
TProofProgressDialog
Definition: TProofProgressDialog.h:41
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:55
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:288
TGListBox::SetMultipleSelections
virtual void SetMultipleSelections(Bool_t multi=kTRUE)
Definition: TGListBox.h:326
kLHintsLeft
@ kLHintsLeft
Definition: TGLayout.h:31
TObject::Info
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition: TObject.cxx:864
TGTextEntry::SetToolTipText
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
Definition: TGTextEntry.cxx:1663
TGLabel
Definition: TGLabel.h:32
TProofProgressLog::fGrepLabel
TGLabel * fGrepLabel
Definition: TProofProgressLog.h:67
TGListBox::Resize
virtual void Resize(UInt_t w, UInt_t h)
Resize the listbox widget.
Definition: TGListBox.cxx:1420
kButtonUp
@ kButtonUp
Definition: TGButton.h:53
TUrl::GetPort
Int_t GetPort() const
Definition: TUrl.h:78
TProofProgressLog::fGrepCheckInv
TGCheckButton * fGrepCheckInv
Definition: TProofProgressLog.h:69
TGTextButton
Definition: TGButton.h:142
TProofProgressLog::fGrepButton
TGTextButton * fGrepButton
Definition: TProofProgressLog.h:61
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:543
TProofProgressLog::LogMessage
void LogMessage(const char *msg, Bool_t all)
Load/append a log msg in the log frame, if open.
Definition: TProofProgressLog.cxx:518
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
Definition: TGText.h:67
TGMainFrame::SetWindowName
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition: TGFrame.cxx:1749
TGHorizontalFrame
Definition: TGFrame.h:423
TGNumberEntry::GetNumberEntry
TGNumberEntryField * GetNumberEntry() const
Definition: TGNumberEntry.h:268
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:2311
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:246
TString
Basic string class.
Definition: TString.h:136
TGFrame
Definition: TGFrame.h:105
TProofProgressLog::kGrep
@ kGrep
Definition: TProofProgressLog.h:43
TProofProgressLog::DoLog
void DoLog(Bool_t grep=kFALSE)
Display logs.
Definition: TProofProgressLog.cxx:387
TGLabel::SetText
virtual void SetText(TGString *newText)
Set new text in label.
Definition: TGLabel.cxx:179
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:874
TGFrame::MapWindow
virtual void MapWindow()
map window
Definition: TGFrame.h:229
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:262
TGCheckButton::SetDisabledAndSelected
virtual void SetDisabledAndSelected(Bool_t)
Set the state of a check button to disabled and either on or off.
Definition: TGButton.cxx:1263
TProofProgressLog::NoLineEntry
void NoLineEntry()
Enable/disable the line number entry.
Definition: TProofProgressLog.cxx:598
TGTextEntry::SetDefaultSize
virtual void SetDefaultSize(UInt_t w, UInt_t h)
Set the default / minimal size of the widget.
Definition: TGTextEntry.cxx:396
TString::kBoth
@ kBoth
Definition: TString.h:267
TProofProgressDialog::fStatus
EQueryStatus fStatus
Definition: TProofProgressDialog.h:85
TGListBox::Layout
virtual void Layout()
Layout the listbox components.
Definition: TGListBox.cxx:1461
gClient
#define gClient
Definition: TGClient.h:166
kLHintsBottom
@ kLHintsBottom
Definition: TGLayout.h:36
TGCheckButton
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:2289
TGFrame::DeleteWindow
virtual void DeleteWindow()
Delete window.
Definition: TGFrame.cxx:261
TProof::Mgr
static TProofMgr * Mgr(const char *url)
Get instance of the effective manager for 'url' Return 0 on failure.
Definition: TProof.cxx:11714
TProofProgressLog::fLogList
TGListBox * fLogList
Definition: TProofProgressLog.h:50
TPRegexp.h
TProofProgressLog::fVworkers
TGVerticalFrame * fVworkers
Definition: TProofProgressLog.h:66
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:1362
TProofProgressLog::fSessionUrl
TString fSessionUrl
Definition: TProofProgressLog.h:45
kDefaultActive
const UInt_t kDefaultActive
Definition: TProofProgressLog.cxx:26
TProofProgressLog::Clear
void Clear(Option_t *=0)
Clear log window.
Definition: TProofProgressLog.cxx:270
TProofProgressDialog::fLogWindow
TProofProgressLog * fLogWindow
Definition: TProofProgressDialog.h:75
TObject::ResetBit
void ResetBit(UInt_t f)
Definition: TObject.h:171
TProofProgressDialog::fProof
TProof * fProof
Definition: TProofProgressDialog.h:77
kLHintsCenterY
@ kLHintsCenterY
Definition: TGLayout.h:35
TGDimension::fHeight
UInt_t fHeight
Definition: TGDimension.h:30
TGTextView::Clear
virtual void Clear(Option_t *="")
Clear text view widget.
Definition: TGTextView.cxx:429
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:58
TProofLog.h
TGCompositeFrame::MapSubwindows
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1149
TGVerticalFrame
Definition: TGFrame.h:412
TGFrame::Resize
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:590
TGTextEntry
Definition: TGTextEntry.h:39
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:533
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
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:43
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:470
kLHintsRight
@ kLHintsRight
Definition: TGLayout.h:33
TGLayoutHints
Definition: TGLayout.h:57
TProofProgressLog::fClose
TGTextButton * fClose
Definition: TProofProgressLog.h:49
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:279
TProofProgressLog::Init
void Init(Int_t w=700, Int_t h=600)
Init window frame for log messages.
Definition: TProofProgressLog.cxx:69
UInt_t
unsigned int UInt_t
Definition: RtypesCore.h:46
TProofProgressLog::fTextType
Int_t fTextType
Definition: TProofProgressLog.h:72
TProofProgressLog::fFileName
TGTextEntry * fFileName
Definition: TProofProgressLog.h:59
kLHintsExpandY
@ kLHintsExpandY
Definition: TGLayout.h:38
TProofProgressLog::fGrepText
TGTextEntry * fGrepText
Definition: TProofProgressLog.h:56
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:53
TProofProgressLog::fLogNew
TGTextButton * fLogNew
Definition: TProofProgressLog.h:51
TGLBEntry
Definition: TGListBox.h:51
TObject::Warning
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:876
TUrl::GetUrl
const char * GetUrl(Bool_t withDeflt=kFALSE) const
Return full URL.
Definition: TUrl.cxx:387
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:569
TGListBox::GetEntry
virtual TGLBEntry * GetEntry(Int_t id) const
Returns list box entry with specified id.
Definition: TGListBox.cxx:1381
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:330
TGListBox::Select
virtual TGLBEntry * Select(Int_t id, Bool_t sel=kTRUE)
Definition: TGListBox.h:351
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:1534
TProofProgressLog::BuildLogList
void BuildLogList(Bool_t create=kFALSE)
Build the list of workers.
Definition: TProofProgressLog.cxx:318
TGWindow::GetParent
const TGWindow * GetParent() const
Definition: TGWindow.h:84
TGNumberEntry::SetLimits
virtual void SetLimits(ELimit limits=TGNumberFormat::kNELNoLimits, Double_t min=0, Double_t max=1)
Definition: TGNumberEntry.h:228
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:864
TGListBox::FindEntry
virtual TGLBEntry * FindEntry(const char *s) const
Find entry by name.
Definition: TGListBox.cxx:1644
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:1916
file
Definition: file.py:1
TGTextEntry::GetDefaultSize
virtual TGDimension GetDefaultSize() const
Return the default / minimal size of the widget.
Definition: TGTextEntry.cxx:386
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
Definition: TGTextView.h:33
TGButton.h
TProofProgressLog::AddBuffer
void AddBuffer(const char *buffer)
Add text to the window.
Definition: TProofProgressLog.cxx:297
TProofProgressDialog::fSessionUrl
TString fSessionUrl
Definition: TProofProgressDialog.h:100
TGTextLBEntry
Definition: TGListBox.h:83
kDeepCleanup
@ kDeepCleanup
Definition: TGFrame.h:51
d
#define d(i)
Definition: RSha256.hxx:102
TGTextEntry::GetText
const char * GetText() const
Definition: TGTextEntry.h:134
TGString::GetString
const char * GetString() const
Definition: TGString.h:40
TProofProgressLog::Select
void Select(Int_t id, Bool_t all=kTRUE)
actions of select all/clear all button
Definition: TProofProgressLog.cxx:613
TGNumberEntry::GetIntNumber
virtual Long_t GetIntNumber() const
Definition: TGNumberEntry.h:209
TIter
Definition: TCollection.h:233
TProofProgressLog::fSessionIdx
Int_t fSessionIdx
Definition: TProofProgressLog.h:46
TGNumberEntry.h
kLHintsExpandX
@ kLHintsExpandX
Definition: TGLayout.h:37
TGCompositeFrame::SetCleanup
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition: TGFrame.cxx:1057
TProofProgressLog::Rebuild
void Rebuild()
Rebuild the log info for a new entered session.
Definition: TProofProgressLog.cxx:634
TGNumberEntry
Definition: TGNumberEntry.h:157
TProofProgressLog::kStd
@ kStd
Definition: TProofProgressLog.h:43
TNamed::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
TGFrame::Layout
virtual void Layout()
Definition: TGFrame.h:224
TGListBox::AddEntry
virtual void AddEntry(TGString *s, Int_t id)
Add entry with specified string and id to listbox.
Definition: TGListBox.cxx:1212
TProofProgressLog
Definition: TProofProgressLog.h:40
TProofProgressLog::fRawLines
TGCheckButton * fRawLines
Definition: TProofProgressLog.h:64
TProofProgressLog::kRaw
@ kRaw
Definition: TProofProgressLog.h:43
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:2028
TGCompositeFrame::AddFrame
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1102
TProofProgressLog::fUrlText
TGTextEntry * fUrlText
Definition: TProofProgressLog.h:57
TUrl::GetHostFQDN
const char * GetHostFQDN() const
Return fully qualified domain name of url host.
Definition: TUrl.cxx:469
kLogElemFilled
const UInt_t kLogElemFilled
Definition: TProofProgressLog.cxx:25
TGNumberFormat::kNESInteger
@ kNESInteger
Definition: TGNumberEntry.h:34
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:453
TProofProgressLog::fDialog
TProofProgressDialog * fDialog
Definition: TProofProgressLog.h:52
TGTextView::AddText
virtual void AddText(TGText *text)
Add text to the view widget.
Definition: TGTextView.cxx:207
TProofProgressLog::fText
TGTextView * fText
Definition: TProofProgressLog.h:48
int
TGTextLBEntry::GetText
const TGString * GetText() const
Definition: TGListBox.h:114
TError.h
TProofLog::kGrep
@ kGrep
Definition: TProofLog.h:52