1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/Logger.h Mon Jan 04 15:45:12 2021 +0100
1.3 @@ -0,0 +1,44 @@
1.4 +/**
1.5 + * DJM-Fix
1.6 + * Copyright © 2020 František Kučera (Frantovo.cz, GlobalCode.info)
1.7 + *
1.8 + * This program is free software: you can redistribute it and/or modify
1.9 + * it under the terms of the GNU General Public License as published by
1.10 + * the Free Software Foundation, version 3 of the License.
1.11 + *
1.12 + * This program is distributed in the hope that it will be useful,
1.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.15 + * GNU General Public License for more details.
1.16 + *
1.17 + * You should have received a copy of the GNU General Public License
1.18 + * along with this program. If not, see <http://www.gnu.org/licenses/>.
1.19 + */
1.20 +#pragma once
1.21 +
1.22 +#include <iostream>
1.23 +
1.24 +namespace djmfix {
1.25 +namespace logging {
1.26 +
1.27 +enum class Level {
1.28 + SEVERE,
1.29 + WARNING,
1.30 + INFO,
1.31 + CONFIG,
1.32 + FINE,
1.33 + FINER,
1.34 + FINEST,
1.35 +};
1.36 +
1.37 +class Logger {
1.38 +public:
1.39 + virtual ~Logger() = default;
1.40 + virtual void log(Level level, const std::string& message) = 0;
1.41 +};
1.42 +
1.43 +Logger* create(std::ostream& output, Level minLevel);
1.44 +Logger* blackhole();
1.45 +
1.46 +}
1.47 +}
1.48 \ No newline at end of file