Visual Computing Library
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_MISC_LOGGER_NULL_LOGGER_H
24#define VCL_MISC_LOGGER_NULL_LOGGER_H
25
26#include "abstract_logger.h"
27
28#include <vclib/concepts/logger.h>
29
30#include <string>
31
32namespace vcl {
33
44{
45public:
46 NullLogger() = default;
47
48 void enableIndentation() override final {}
49
50 void disableIndentation() override final {}
51
52 void enablePrintPercentage() override final {}
53
54 void disablePrintPercentage() override final {}
55
56 void setPrintLevel(LogLevel) override final {}
57
58 void enablePrintMessageDuringProgress() override final {}
59
60 void disablePrintMessageDuringProgress() override final {}
61
62 void enablePrintTimer() override final {}
63
64 void disablePrintTimer() override final {}
65
66 void reset() override final {}
67
68 void setMaxLineWidth(uint) override final {}
69
70 void startTimer() override final {}
71
72 void stopTimer() override final {}
73
74 double time() const override final { return 0; }
75
76 void startNewTask(double, double, const std::string&) override final {}
77
78 void endTask(const std::string&) override final {}
79
80 double percentage() const override final { return 0; }
81
82 void setPercentage(uint) override final {}
83
84 void log(const std::string&) const override final {}
85
86 void log(const std::string&, LogLevel) const override final {}
87
88 void log(uint, const std::string&) override final {}
89
90 void log(uint, const std::string&, LogLevel) override final {}
91
92 void startProgress(const std::string&, uint, uint = 0, uint = 0, uint = 0)
94 {
95 }
96
98
99 void progress(uint) override final {}
100};
101
126
127} // namespace vcl
128
129#endif // VCL_MISC_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:39
The NullLogger class is used as default type in all the library functions that take as input a logger...
Definition null_logger.h:44
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:92
void endProgress() override final
Allows to easily manage progresses with the logger, along with the startProgress and progress member ...
Definition null_logger.h:97
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:90
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:86
void progress(uint) override final
Allows to easily manage progresses with the logger, along with the startProgress and endProgress memb...
Definition null_logger.h:99
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:84
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:74
void setPrintLevel(LogLevel) override final
Sets the maximum print level of the logger.
Definition null_logger.h:56
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:88
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43
NullLogger nullLogger
The nullLogger object is an object of type NullLogger that is used as default argument in the functio...
Definition null_logger.h:125