General and Desktop
2017.01.13 00:41

Qt Logging Rule, Qt 프레임워크 로그 출력

조회 수 7331 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

로깅 규칙을 사용하면 Qt 프레임워크 로그 범주를 유연하게 활성화 또는 비활성화 할 수 있다.

 

Qt 5.3부터 로깅 규칙은 QT_LOGGING_RULES 환경 변수에서 설정하거나 로깅 구성파일에 명시할 수 있는데, 실행시 로깅 구성 파일의 [Rules] 섹션에서 자동으로 로드된다. 이러한 구성 파일은 QtProject 구성 디렉토리에서 찾고 QT_LOGGING_CONF 환경 변수에 명시적으로 설정된다.

 

아래는 scenegraph관련 로깅을 위해 qtlogging.ini 명시하였다. 

QtProject/qtlogging.ini
[Rules]
*.debug=false
qt.scenegraph.*=true
 

다른 방법으로 setFilterRules() 함수를 호출할 수 도있다.

아래는 QPA 플랫폼을 확인하기 위해 소스코드에서 setFilterRules()을 이용하여 로깅룰을 설정한 예이다.

#include <QLoggingCategory>
 
int main(int argc, char *argv[])
{
    ...
    QLoggingCategory::setFilterRules(QStringLiteral("qt.qpa.*=true"));
    ...
}
 

또는 아래와 같은 방법들도 있다.

 

환경변수에 정의한 ini안에 [Rules] 섹션에 정의하는 방법 (Qt 5.3부터)

qputenv("QT_LOGGING_CONF","C:/Project/test_config.ini");

test_config.ini

[Rules]
*.debug=false
qt.scenegraph.*=true

 

QT_LOGGING_RULES환경변수에 정의하는 방법 (Qt 5.3부터)

qputenv("QT_LOGGING_RULES", "qt.scenegraph*=true");

 

QLoggingCategory클래스에 대한 자세한 정보 및 다른 방법들은 아래 링크참조.

http://doc.qt.io/qt-5/qloggingcategory.html


  1. No Image notice

    Qt프로그래밍(QtQuick) Beginner를 위한 글 읽는 순서

    Date2019.01.05 CategoryQML and Qt Quick By운영자 Views110094
    read more
  2. Windows환경에서 mingw로 Qt 5.10 정적(static)빌드

    Date2018.02.01 CategoryInstallation and Deployment Bymakersweb Views8261
    Read More
  3. 다국어 지원 어플리케이션 개발

    Date2018.01.27 CategoryGeneral and Desktop Bymakersweb Views5453
    Read More
  4. No Image

    Qt 어플리에이션 전역에 폰트 설정

    Date2018.01.24 CategoryGeneral and Desktop Bymakersweb Views8508
    Read More
  5. Qt 3D Studio 시작하기

    Date2018.01.11 CategoryInstallation and Deployment Bymakersweb Views6265
    Read More
  6. No Image

    QPA 플러그인과 HTML5 Backend

    Date2017.12.27 CategoryMobile and Embedded Bymakersweb Views3711
    Read More
  7. 임의의 메모리 영역(QImage)에 QPainter를 이용하여 그리기

    Date2017.12.19 CategoryGeneral and Desktop Bymakersweb Views6552
    Read More
  8. No Image

    QML에서 undefined를 확인하는 방법

    Date2017.11.29 CategoryQML and Qt Quick Bymakersweb Views4376
    Read More
  9. QPA 플러그인과 EGLFS

    Date2017.11.21 CategoryMobile and Embedded Bymakersweb Views7326
    Read More
  10. No Image

    타임스탬프( timestamp) 유닉스 시간

    Date2017.10.19 CategoryGeneral and Desktop Bymakersweb Views4697
    Read More
  11. No Image

    Qt Logging Rule, Qt 프레임워크 로그 출력

    Date2017.01.13 CategoryGeneral and Desktop Bymakersweb Views7331
    Read More
  12. No Image

    QString 문자열에서 숫자만 추출해서 QString으로 반환

    Date2017.01.10 Bymakersweb Views6062
    Read More
  13. No Image

    멀티 스레드환경, 스레드에 안전한 이벤트처리

    Date2016.10.27 CategoryGeneral and Desktop Bymakersweb Views7713
    Read More
  14. Ubuntu Linux에서 Qt Creator 설치

    Date2016.03.06 CategoryInstallation and Deployment Bymakersweb Views13849
    Read More
  15. QtConcurrent를 이용하여 쓰레드를 만드는 방법과 MapReduce

    Date2016.01.24 Bymakersweb Views12264
    Read More
  16. No Image

    Qt 프로그래밍의 시작

    Date2015.10.25 CategoryGeneral and Desktop Bymakersweb Views17918
    Read More
  17. No Image

    Qt의 스레드간 시그널 슬롯의 커넥션타입

    Date2015.10.24 CategoryGeneral and Desktop Bymakersweb Views13767
    Read More
  18. Qt의 시그널 슬롯 시스템

    Date2015.10.20 CategoryGeneral and Desktop Bymakersweb Views27676
    Read More
  19. No Image

    QQuickImageProvider 를 이용한 Qml 에서 이미지 표시

    Date2015.10.18 CategoryC++ Class Bymakersweb Views8567
    Read More
  20. Qml 사용자 ScrollBar 구현

    Date2015.07.24 CategoryQML and Qt Quick Bymakersweb Views8688
    Read More
  21. No Image

    z-order 를 컨트롤 하기위한 방법

    Date2015.05.13 CategoryQML and Qt Quick Bymakersweb Views9658
    Read More
Board Pagination Prev 1 ... 5 6 7 8 9 Next
/ 9