Commit c7590f90 authored by Méven Car's avatar Méven Car
Browse files

Add a logging category config file

Makes powerdevil default logging level Warning
parent c9cae20f
......@@ -11,6 +11,7 @@ find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(ECMSetupVersion)
include(ECMQtDeclareLoggingCategory)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
......@@ -76,6 +77,7 @@ add_subdirectory(daemon)
add_subdirectory(kcmodule)
add_subdirectory(doc)
install( FILES powerdevil.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
install( FILES powerdevil.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFY5RCDIR} )
# add clang-format target for all our real source files
......
......@@ -48,6 +48,12 @@ set(powerdevilcore_SRCS
kwinkscreenhelpereffect.cpp
)
ecm_qt_declare_logging_category(powerdevilcore_SRCS
HEADER powerdevil_debug.h
IDENTIFIER POWERDEVIL
CATEGORY_NAME org.kde.powerdevil
DEFAULT_SEVERITY Warning)
kconfig_add_kcfg_files(powerdevilcore_SRCS ../PowerDevilSettings.kcfgc)
# Action DBus Adaptors
......
......@@ -3,7 +3,7 @@ include_directories(${PowerDevil_SOURCE_DIR}/daemon
${CMAKE_CURRENT_BINARY_DIR})
set(powerdevildpmsaction_SRCS
${PowerDevil_SOURCE_DIR}/daemon/powerdevil_debug.cpp
${CMAKE_CURRENT_BINARY_DIR}/../../powerdevil_debug.cpp
powerdevildpmsaction.cpp
abstractdpmshelper.cpp
xcbdpmshelper.cpp
......
......@@ -4,7 +4,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/upower
${X11_Xrandr_INCLUDE_PATH})
set(powerdevilupowerbackend_SRCS
${PowerDevil_SOURCE_DIR}/daemon/powerdevil_debug.cpp
${CMAKE_CURRENT_BINARY_DIR}/../powerdevil_debug.cpp
upower/upowersuspendjob.cpp
upower/login1suspendjob.cpp
upower/powerdevilupowerbackend.cpp
......@@ -33,14 +33,14 @@ ${CMAKE_CURRENT_SOURCE_DIR}/upower/dbus/org.freedesktop.UPower.KbdBacklight.xml
upower_kbdbacklight_interface)
## backlight helper executable
add_executable(backlighthelper upower/backlighthelper.cpp ${PowerDevil_SOURCE_DIR}/daemon/powerdevil_debug.cpp ${backlighthelper_mocs})
add_executable(backlighthelper upower/backlighthelper.cpp ${CMAKE_CURRENT_BINARY_DIR}/../powerdevil_debug.cpp ${backlighthelper_mocs})
target_link_libraries(backlighthelper Qt5::Core KF5::AuthCore KF5::I18n)
install(TARGETS backlighthelper DESTINATION ${KAUTH_HELPER_INSTALL_DIR})
kauth_install_helper_files(backlighthelper org.kde.powerdevil.backlighthelper root)
kauth_install_actions(org.kde.powerdevil.backlighthelper ${CMAKE_CURRENT_SOURCE_DIR}/upower/backlight_helper_actions.actions)
## discrete gpu helper executable
add_executable(discretegpuhelper upower/discretegpuhelper.cpp ${PowerDevil_SOURCE_DIR}/daemon/powerdevil_debug.cpp ${discretegpuhelper_mocs})
add_executable(discretegpuhelper upower/discretegpuhelper.cpp ${CMAKE_CURRENT_BINARY_DIR}/../powerdevil_debug.cpp ${discretegpuhelper_mocs})
target_link_libraries(discretegpuhelper Qt5::Core KF5::AuthCore)
install(TARGETS discretegpuhelper DESTINATION ${KAUTH_HELPER_INSTALL_DIR})
kauth_install_helper_files(discretegpuhelper org.kde.powerdevil.discretegpuhelper root)
......
/* This file is part of the KDE project
Copyright (C) 2014 Hrvoje Senjan <hrvoje.senjan@gmail.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "powerdevil_debug.h"
Q_LOGGING_CATEGORY(POWERDEVIL, "powerdevil")
/* This file is part of the KDE project
Copyright (C) 2014 Hrvoje Senjan <hrvoje.senjan@gmail.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef POWERDEVIL_DEBUG_H
#define POWERDEVIL_DEBUG_H
#include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(POWERDEVIL)
#endif
add_definitions(-DTRANSLATION_DOMAIN=\"powerdevilactivitiesconfig\")
set( kcm_powerdevil_activities_SRCS
${PowerDevil_SOURCE_DIR}/daemon/powerdevil_debug.cpp
${CMAKE_CURRENT_BINARY_DIR}/../../daemon/powerdevil_debug.cpp
activitypage.cpp
activitywidget.cpp
../common/ErrorOverlay.cpp
......
add_definitions(-DTRANSLATION_DOMAIN=\"libpowerdevilcommonconfig\")
set( powerdevil_config_common_private_SRCS
${PowerDevil_SOURCE_DIR}/daemon/powerdevil_debug.cpp
${CMAKE_CURRENT_BINARY_DIR}/../../daemon/powerdevil_debug.cpp
actionconfigwidget.cpp
actioneditwidget.cpp
ErrorOverlay.cpp
......
add_definitions(-DTRANSLATION_DOMAIN=\"powerdevilprofilesconfig\")
set( kcm_powerdevil_profiles_SRCS
${PowerDevil_SOURCE_DIR}/daemon/powerdevil_debug.cpp
${CMAKE_CURRENT_BINARY_DIR}/../../daemon/powerdevil_debug.cpp
EditPage.cpp
${PowerDevil_SOURCE_DIR}/daemon/powerdevilprofilegenerator.cpp
)
......
org.kde.powerdevil Powerdevil DEFAULT_SEVERITY [WARNING] IDENTIFIER [POWERDEVIL]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment