GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
MainGo4TaskHandlerClient.cxx
Go to the documentation of this file.
1 // $Id$
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 
15 #include <iostream>
16 
17 #include "TApplication.h"
18 
19 #include "TGo4Log.h"
20 #include "TGo4ExampleClient.h"
21 
22 int main(int argc, char **argv)
23 {
24  if (argc < 4) {
25  std::cout << "usage: MainGo4TaskHandlerClient clientname serverhostname connectorport" << std::endl;
26  return 0;
27  }
28 
29  TApplication theApp("App", &argc, argv);
30  TGo4Log::Instance(); // init logger object
31  TGo4Log::SetIgnoreLevel(0); // set this to 1 to suppress detailed debug output
32  // set this to 2 to get warnings and errors only
33  // set this to 3 to get errors only
34  TGo4Log::LogfileEnable(kFALSE); // will enable or disable logging all messages to file
35 
36  const char *name = argv[1];
37  const char *hostname = argv[2];
38  const char *connector = argv[3];
39  UInt_t con = atoi(connector);
40  std::cout << "Client:" << name << ",\tHost:" << hostname << ",\tConnector:" << con << std::endl;
41  TGo4ExampleClient *myclient = new TGo4ExampleClient(name, hostname, con);
42  std::cout << "Created ExampleClient Instance: " << myclient->GetName() << std::endl; // dummy action for warnings
43  theApp.Run();
44  return 0;
45 }
static TGo4Log * Instance()
Definition: TGo4Log.cxx:85
static void SetIgnoreLevel(Int_t level)
Definition: TGo4Log.cxx:332
int main(int argc, char **argv)
static void LogfileEnable(Bool_t on=kTRUE)
Definition: TGo4Log.cxx:363