File: logging.h

package info (click to toggle)
libappimage 1.0.4-5-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,320 kB
  • sloc: cpp: 4,678; ansic: 1,325; sh: 169; python: 27; makefile: 19
file content (22 lines) | stat: -rw-r--r-- 554 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#pragma once

#include <string>
#include <functional>

namespace appimage {
    namespace utils {
        enum class LogLevel {
            DEBUG = 0, INFO, WARNING, ERROR
        };

        typedef std::function<void(const utils::LogLevel& level, const std::string& message)> log_callback_t;

        /**
         * @brief Set a custom logging function.
         * Allows to capture the libappimage log messages.
         *
         * @param logging function callback
         */
        void setLoggerCallback(const log_callback_t& callback);
    }
}