StormByte C++ Library: Logger module 1.2.0
StormByte-Logger is the logging module of the StormByte C++ suite.
Loading...
Searching...
No Matches
exception.hxx
Go to the documentation of this file.
1/*
2 * Copyright (C) 2024-2026 David C. Manuelda (StormBytePP)
3 *
4 * This file is part of StormByte-Logger.
5 *
6 * StormByte-Logger is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License version 3
8 * or later, as published by the Free Software Foundation.
9 *
10 * StormByte-Logger is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with StormByte-Logger. If not, see
17 * <https://www.gnu.org/licenses/lgpl-3.0.html>.
18 */
19
20#pragma once
21
22#include <StormByte/exception.hxx>
24
25#include <format>
26#include <string>
27#include <utility>
28
33namespace StormByte::Logger {
38 class STORMBYTE_LOGGER_PUBLIC Exception: public StormByte::Exception {
39 public:
41 explicit Exception(const std::string& message):
42 StormByte::Exception(StormByte::Component{"Logger"}, "{}", message) {}
43
45 explicit Exception(std::string&& message):
46 StormByte::Exception(StormByte::Component{"Logger"}, "{}", std::move(message)) {}
47
54 template <typename... Args>
55 Exception(std::format_string<Args...> fmt, Args&&... args):
56 StormByte::Exception(StormByte::Component{"Logger"}, fmt, std::forward<Args>(args)...) {}
57 };
58
64 public:
65 using Exception::Exception;
66 };
67}
Root exception for Logger errors.
Definition exception.hxx:38
Exception(const std::string &message)
Construct with an unformatted message.
Definition exception.hxx:41
Exception(std::string &&message)
Construct with a moved message.
Definition exception.hxx:45
Exception(std::format_string< Args... > fmt, Args &&... args)
Construct with a formatted message.
Definition exception.hxx:55
Thrown when a throttle rule is invalid.
Definition exception.hxx:63
Logger module of the StormByte suite.
#define STORMBYTE_LOGGER_PUBLIC
Definition visibility.h:28