/usr/include/KF5/KScreen/kscreen/log.h is in libkf5screen-dev 4:5.12.4-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | /*************************************************************************************
 *  Copyright 2016 by Sebastian Kügler <sebas@kde.org>                               *
 *                                                                                   *
 *  This library is free software; you can redistribute it and/or                    *
 *  modify it under the terms of the GNU Lesser General Public                       *
 *  License as published by the Free Software Foundation; either                     *
 *  version 2.1 of the License, or (at your option) any later version.               *
 *                                                                                   *
 *  This library is distributed in the hope that it will be useful,                  *
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of                   *
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                *
 *  Lesser General Public License for more details.                                  *
 *                                                                                   *
 *  You should have received a copy of the GNU Lesser General Public                 *
 *  License along with this library; if not, write to the Free Software              *
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA       *
 *************************************************************************************/
#ifndef KSCREEN_LOG_H
#define KSCREEN_LOG_H
#include "kscreen_export.h"
#include "types.h"
#include <QObject>
#include <QLoggingCategory>
namespace KScreen {
void log(const QString& msg);
/** KScreen-internal file logging.
 *
 * The purpose of this class is to allow better debugging of kscreen. QDebug falls short here, since
 * we need to debug the concert of kscreen components from different processes.
 *
 * KScreen::Log manages access to kscreen's log file.
 *
 * The following environment variables are considered:
 * - disable logging by setting
 * KSCREEN_LOGGING=false
 * - set the log file to a custom path, the default is in ~/.local/share/kscreen/kscreen.log
 *
 * Please do not translate messages written to the logs, it's developer information and should be
 * english, independent from the user's locale preferences.
 *
 * @code
 *
 * Log::instance()->setContext("resume");
 * Log::log("Applying detected output configuration.");
 *
 * @endcode
 *
 * @since 5.8
 */
class KSCREEN_EXPORT Log
{
    public:
        virtual ~Log();
        static Log* instance();
        /** Log a message to a file
         *
         * Call this static method to add a new line to the log.
         *
         * @arg msg The log message to write.
         */
        static void log(const QString &msg, const QString &category = QString());
        /** Context for the logs.
         *
         * The context can be used to indicate what is going on overall, it is used to be able
         * to group log entries into subsequential operations. For example the context can be
         * "handling resume", which is then added to the log messages.
         *
         * @arg msg The log message to write to the file.
         *
         * @see ontext()
         */
        QString context() const;
        /** Set the context for the logs.
         *
         * @see context()
         */
        void setContext(const QString &context);
        /** Logging to file is enabled by environmental var, is it?
         *
         * @arg msg The log message to write to the file.
         * @return Whether logging is enabled.
         */
        bool enabled() const;
        /** Path to the log file
         *
         * This is usually ~/.local/share/kscreen/kscreen.log, but can be changed by setting
         * KSCREEN_LOGFILE in the environment.
         *
         * @return The path to the log file.
         */
        QString logFile() const;
    private:
        explicit Log();
        class Private;
        Private * const d;
        static Log* sInstance;
        Log(Private *dd);
};
} //KSCreen namespace
#endif //KSCREEN_LOG_H
 |