GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
MainGo4TaskHandlerClient.cxx
Go to the documentation of this file.
1 // $Id: MainGo4TaskHandlerClient.cxx 934 2013-01-29 15:59:24Z linev $
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 für 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 #include <stdlib.h>
15 
16 #include "TApplication.h"
17 #include "Riostream.h"
18 
19 #include "TGo4Log.h"
20 #include "TGo4ExampleClient.h"
21 
22 void usage();
23 
24 int main(int argc, char **argv)
25 {
26  TApplication theApp("App", &argc, argv);
27  TGo4Log::Instance(); // init logger object
28  TGo4Log::SetIgnoreLevel(0); // set this to 1 to suppress detailed debug output
29  // set this to 2 to get warnings and errors only
30  // set this to 3 to get errors only
31  TGo4Log::LogfileEnable(kFALSE); // will enable or disable logging all messages to file
32 
33  if(argc<4)
34  {
35  usage();
36 
37  }
38  else
39  {
40  const char* name=argv[1];
41  const char* hostname=argv[2];
42  const char* connector=argv[3];
43  UInt_t con=atoi(connector);
44  std::cout << "Client:"<<name<<",\tHost:"<<hostname<<",\tConnector:"<<con<<std::endl;
45  TGo4ExampleClient* myclient = new TGo4ExampleClient(name,hostname,con);
46  std::cout << "Created ExampleClient Instance: "<<myclient->GetName()<<std::endl; // dummy action for warnings
47  theApp.Run();
48  return 0;
49  } // if(argc<4)
50 }
51 
52 
53 void usage()
54 {
55  std::cout << "usage: MainGo4TaskHandlerClient clientname serverhostname connectorport"<<std::endl;
56 }
static TGo4Log * Instance()
Definition: TGo4Log.cxx:87
static void SetIgnoreLevel(Int_t level)
Definition: TGo4Log.cxx:322
int main(int argc, char **argv)
void usage()
static void LogfileEnable(Bool_t on=kTRUE)
Definition: TGo4Log.cxx:369