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