Visual Computing Library  devel
Loading...
Searching...
No Matches
null_logger.h
1/*****************************************************************************
2 * VCLib *
3 * Visual Computing Library *
4 * *
5 * Copyright(C) 2021-2025 *
6 * Visual Computing Lab *
7 * ISTI - Italian National Research Council *
8 * *
9 * All rights reserved. *
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the Mozilla Public License Version 2.0 as published *
13 * by the Mozilla Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 * This program is distributed in the hope that it will be useful, *
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
19 * Mozilla Public License Version 2.0 *
20 * (https://www.mozilla.org/en-US/MPL/2.0/) for more details. *
21 ****************************************************************************/
22
23#ifndef VCL_BASE_LOGGER_NULL_LOGGER_H
24#define VCL_BASE_LOGGER_NULL_LOGGER_H
25
26#include "abstract_logger.h"
27
28#include <string>
29
30namespace vcl {
31
42{
43public:
44 NullLogger() = default;
45
46 void enableIndentation() override final {}
47
48 void disableIndentation() override final {}
49
50 void enablePrintPercentage() override final {}
51
52 void disablePrintPercentage() override final {}
53
54 void setPrintLevel(LogLevel) override final {}
55
56 void enablePrintMessageDuringProgress() override final {}
57
58 void disablePrintMessageDuringProgress() override final {}
59
60 void enablePrintTimer() override final {}
61
62 void disablePrintTimer() override final {}
63
64 void reset() override final {}
65
66 void setMaxLineWidth(uint) override final {}
67
68 void startTimer() override final {}
69
70 void stopTimer() override final {}
71
72 double time() const override final { return 0; }
73
74 void startNewTask(double, double, const std::string&) override final {}
75
76 void endTask(const std::string&) override final {}
77
78 double percentage() const override final { return 0; }
79
80 void setPercentage(uint) override final {}
81
82 void log(const std::string&) const override final {}
83
84 void log(const std::string&, LogLevel) const override final {}
85
86 void log(uint, const std::string&) override final {}
87
88 void log(uint, const std::string&, LogLevel) override final {}
89
90 void startProgress(const std::string&, uint, uint = 0, uint = 0, uint = 0)
92 {
93 }
94
96
97 void progress(uint) override final {}
98};
99
124
125} // namespace vcl
126
127#endif // VCL_BASE_LOGGER_NULL_LOGGER_H
The AbstractLogger class is used as common ancestor class for all the logger types in the library.
Definition abstract_logger.h:40
A class representing a box in N-dimensional space.
Definition box.h:46
The NullLogger class is used as default type in all the library functions that take as input a logger...
Definition null_logger.h:42
void startProgress(const std::string &, uint, uint=0, uint=0, uint=0) override final
Allows to easily manage progresses with the logger, along with the progress and endProgress member fu...
Definition null_logger.h:90
void endProgress() override final
Allows to easily manage progresses with the logger, along with the startProgress and progress member ...
Definition null_logger.h:95
void log(uint, const std::string &, LogLevel) override final
Prints a message to the logger, with the given level and with the given percentage.
Definition null_logger.h:88
void log(const std::string &, LogLevel) const override final
Prints a message to the logger, with the given level and without modifying the current percentage.
Definition null_logger.h:84
void progress(uint) override final
Allows to easily manage progresses with the logger, along with the startProgress and endProgress memb...
Definition null_logger.h:97
void log(const std::string &) const override final
Prints a message to the logger, with level LogLevel::PROGRESS and without modifying the current perce...
Definition null_logger.h:82
double time() const override final
Returns the time passed since the last call to startTimer member function, or the time passed between...
Definition null_logger.h:72
void setPrintLevel(LogLevel) override final
Sets the maximum print level of the logger.
Definition null_logger.h:54
void log(uint, const std::string &) override final
Prints a message to the logger, with the level LogLevel::PROGRESS and with the given percentage.
Definition null_logger.h:86
NullLogger nullLogger
The nullLogger object is an object of type NullLogger that is used as default argument in the functio...
Definition null_logger.h:123