source: src/Helpers/Log.cpp@ 4fb16c

Last change on this file since 4fb16c was 115378, checked in by Frederik Heber <heber@…>, 15 years ago

Changes to allow for (re-)incorporation of CodePatterns into MoleCuilder.

library:

  • no more suffixed with version, this should be dealt by pkg-config (.pc) or a contained version information.
  • corrected and extended .pc file
  • m4 macro ax_codepatterns.m4 created to allow for easy checking with autotools

codepatterns-config:

  • if pkg-config fails there is a small tool that tells about necessary cflags and the likes to compile with CodePatterns library (this was developed before we noticed we had a (half-)working pkg-config present).

smaller changes:

  • moved all Helpers files to src/Helpers (again).
  • changed include paths for Assert.hpp, ... accordingly.
  • version is not prefixed with "v" anymore.
  • small stuff in fast_functions.hpp is absolete (stl::algorithms)
  • Helpers/enumeration.hpp contains enumeration class ("iterable enum")
  • Property mode set to 100644
File size: 1.9 KB
Line 
1/*
2 * Project: MoleCuilder
3 * Description: creates and alters molecular systems
4 * Copyright (C) 2010 University of Bonn. All rights reserved.
5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
6 */
7
8/*
9 * log.cpp
10 *
11 * Created on: Oct 19, 2009
12 * Author: metzler
13 */
14
15// include config.h
16#ifdef HAVE_CONFIG_H
17#include <config.h>
18#endif
19
20#include "MemDebug.hpp"
21
22#include "logger.hpp"
23#include "errorlogger.hpp"
24
25/**
26 * Sets verbosity for the error logger and the standard logger.
27 *
28 * \param int verbosity level
29 */
30void setVerbosity(int verbosityLevel) {
31 logger::getInstance().setVerbosity(verbosityLevel);
32}
33
34/**
35 * Gets verbosity for the error logger and the standard logger.
36 *
37 * \param int verbosity level
38 */
39int getVerbosity() {
40 return logger::getInstance().getVerbosity();
41}
42
43/**
44 * Prints a log entry.
45 *
46 * \param indentation level of the message to log
47 */
48class logger& Log() {
49 return logger::getInstance();
50}
51
52/** Checks verbosity for logger.
53 * Is supposed to be used in construct as this:
54 * DoLog(2) && (Log() << Verbose(2) << "message." << endl);
55 * If DoLog does not return true, the right-hand side is not evaluated and we save some time.
56 * \param verbose verbosity level of this message
57 * \return true - print, false - don't
58 */
59bool DoLog(int verbose) {
60 return (verbose <= logger::getInstance().verbosity);
61}
62
63/** Checks verbosity for errorlogger.
64 * Is supposed to be used in construct as this:
65 * DoLog(2) && (Log() << Verbose(2) << "message." << endl);
66 * If DoLog does not return true, the right-hand side is not evaluated and we save some time.
67 * \param verbose verbosity level of this message
68 * \return true - print, false - don't
69 */
70bool DoeLog(int verbose) {
71 return (verbose <= errorLogger::getInstance().verbosity);
72}
73
74/**
75 * Prints an error log entry.
76 *
77 * \param indentation level of the message to log
78 */
79class errorLogger & eLog() {
80 return errorLogger::getInstance();
81}
Note: See TracBrowser for help on using the repository browser.