IODA Bundle
ODBApplication.cc
Go to the documentation of this file.
1 /*
2  * (C) Copyright 1996-2012 ECMWF.
3  *
4  * This software is licensed under the terms of the Apache Licence Version 2.0
5  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6  * In applying this licence, ECMWF does not waive the privileges and immunities
7  * granted to it by virtue of its status as an intergovernmental organisation nor
8  * does it submit to any jurisdiction.
9  */
10 
11 /// \file ODBApplication.h
12 ///
13 /// @author Piotr Kuchta, ECMWF, Feb 2009
14 
15 #include "eckit/config/Resource.h"
16 #include "eckit/log/OStreamTarget.h"
17 #include "eckit/log/Colour.h"
18 #include "eckit/log/ColouringTarget.h"
19 
20 #include "odc/ODBApplication.h"
21 #include "odc/ODBTarget.h"
22 
23 using namespace eckit;
24 
25 namespace odc {
26 namespace tool {
27 
28 ODBApplication::ODBApplication (int argc, char **argv)
29 : Tool(argc, argv),
30  clp_(argc, argv) {
31 }
32 
34 
36 
37 static LogTarget* cerr_target() { return new OStreamTarget(std::cerr); }
38 
39 eckit::LogTarget* ODBApplication::createInfoLogTarget() const { return new ODBTarget("(I)", cerr_target()); }
40 eckit::LogTarget* ODBApplication::createDebugLogTarget() const { return new ODBTarget("(D)", cerr_target()); }
41 eckit::LogTarget* ODBApplication::createErrorLogTarget() const { return new ODBTarget("(E)", new ColouringTarget(cerr_target(), &Colour::red)); }
42 eckit::LogTarget* ODBApplication::createWarningLogTarget() const { return new ODBTarget("(W)", new ColouringTarget(cerr_target(), &Colour::yellow)); }
43 
44 
45 } // namespace tool
46 } // namespace odc
47 
virtual eckit::LogTarget * createDebugLogTarget() const
CommandLineParser & commandLineParser()
virtual eckit::LogTarget * createErrorLogTarget() const
virtual eckit::LogTarget * createWarningLogTarget() const
virtual eckit::LogTarget * createInfoLogTarget() const
CommandLineParser clp_
static LogTarget * cerr_target()
Definition: ColumnInfo.h:23