Loading...
Searching...
No Matches
elxlog.h
Go to the documentation of this file.
/*=========================================================================
*
* Copyright UMC Utrecht and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef elxlog_h
#define elxlog_h
#include <cstdint> // For uint8_t.
#include <string>
#include <sstream>
namespace elastix
{
class log
{
public:
enum class level : std::uint8_t
{
info,
warn,
err,
off
};
static bool
setup(const std::string & log_filename,
const bool do_log_to_file,
const bool do_log_to_stdout,
const level log_level = {});
class guard
{
public:
guard();
guard(const std::string & log_filename,
const bool do_log_to_file,
const bool do_log_to_stdout,
const level log_level);
~guard();
};
static void
info(const std::string & message);
static void
warn(const std::string & message);
static void
error(const std::string & message);
static void
info(const std::ostream & stream);
static void
warn(const std::ostream & stream);
static void
error(const std::ostream & stream);
static void
info_to_log_file(const std::string & message);
static void
info_to_log_file(const std::ostream & stream);
static void
to_stdout(const std::string & message);
static void
to_stdout(const std::ostream & stream);
};
} // end namespace elastix
#endif
elastix::log::guard::~guard
~guard()
elastix::log::guard::guard
guard()
elastix::log::guard::guard
guard(const std::string &log_filename, const bool do_log_to_file, const bool do_log_to_stdout, const level log_level)
elastix::log
Definition elxlog.h:32
elastix::log::to_stdout
static void to_stdout(const std::string &message)
elastix::log::info_to_log_file
static void info_to_log_file(const std::string &message)
elastix::log::info
static void info(const std::string &message)
elastix::log::error
static void error(const std::string &message)
elastix::log::setup
static bool setup(const std::string &log_filename, const bool do_log_to_file, const bool do_log_to_stdout, const level log_level={})
elastix::log::warn
static void warn(const std::string &message)
elastix::log::info_to_log_file
static void info_to_log_file(const std::ostream &stream)
elastix::log::to_stdout
static void to_stdout(const std::ostream &stream)
elastix::log::info
static void info(const std::ostream &stream)
elastix::log::level
level
Definition elxlog.h:35
elastix::log::level::off
@ off
Definition elxlog.h:39
elastix::log::level::err
@ err
Definition elxlog.h:38
elastix::log::error
static void error(const std::ostream &stream)
elastix::log::warn
static void warn(const std::ostream &stream)
elastix
Definition elxDefaultConstruct.h:25

Generated on 1768596610 for elastix by 1.15.0 |