[][src]Struct qt_core::QMessageLogger

#[repr(C)]pub struct QMessageLogger { /* fields omitted */ }

The QMessageLogger class generates log messages.

C++ class: QMessageLogger.

C++ documentation:

The QMessageLogger class generates log messages.

QMessageLogger is used to generate messages for the Qt logging framework. Usually one uses it through qDebug(), qInfo(), qWarning(), qCritical, or qFatal() functions, which are actually macros: For example qDebug() expands to QMessageLogger(__FILE__, __LINE__, Q_FUNC_INFO).debug() for debug builds, and QMessageLogger(0, 0, 0).debug() for release builds.

One example of direct use is to forward errors that stem from a scripting language, e.g. QML:

void statusChanged(QDeclarativeComponent::Status status) { if (status == QDeclarativeComponent::Error) { foreach (const QDeclarativeError &error, component->errors()) { const QByteArray file = error.url().toEncoded(); QMessageLogger(file.constData(), error.line(), 0).debug() << error.description(); } } }

Methods

impl QMessageLogger[src]

pub unsafe fn critical_0a(&self) -> CppBox<QDebug>[src]

Logs a critical message using a QDebug stream

Calls C++ function: QDebug QMessageLogger::critical() const.

C++ documentation:

Logs a critical message using a QDebug stream

See also qCritical() and QDebug.

pub unsafe fn critical_1a(
    &self,
    cat: impl CastInto<Ref<QLoggingCategory>>
) -> CppBox<QDebug>
[src]

Logs a critical message into category cat using a QDebug stream.

Calls C++ function: QDebug QMessageLogger::critical(const QLoggingCategory& cat) const.

C++ documentation:

Logs a critical message into category cat using a QDebug stream.

This function was introduced in Qt 5.3.

See also qCCritical() and QDebug.

pub unsafe fn debug_0a(&self) -> CppBox<QDebug>[src]

Logs a debug message using a QDebug stream

Calls C++ function: QDebug QMessageLogger::debug() const.

C++ documentation:

Logs a debug message using a QDebug stream

See also qDebug() and QDebug.

pub unsafe fn debug_1a(
    &self,
    cat: impl CastInto<Ref<QLoggingCategory>>
) -> CppBox<QDebug>
[src]

Logs a debug message into category cat using a QDebug stream.

Calls C++ function: QDebug QMessageLogger::debug(const QLoggingCategory& cat) const.

C++ documentation:

Logs a debug message into category cat using a QDebug stream.

This function was introduced in Qt 5.3.

See also qCDebug() and QDebug.

pub unsafe fn info_0a(&self) -> CppBox<QDebug>[src]

Logs an informational message using a QDebug stream.

Calls C++ function: QDebug QMessageLogger::info() const.

C++ documentation:

Logs an informational message using a QDebug stream.

This function was introduced in Qt 5.5.

See also qInfo() and QDebug.

pub unsafe fn info_1a(
    &self,
    cat: impl CastInto<Ref<QLoggingCategory>>
) -> CppBox<QDebug>
[src]

Logs an informational message into the category cat using a QDebug stream.

Calls C++ function: QDebug QMessageLogger::info(const QLoggingCategory& cat) const.

C++ documentation:

Logs an informational message into the category cat using a QDebug stream.

This function was introduced in Qt 5.5.

See also qCInfo() and QDebug.

pub unsafe fn new_0a() -> CppBox<QMessageLogger>[src]

Constructs a default QMessageLogger. See the other constructors to specify context information.

Calls C++ function: [constructor] void QMessageLogger::QMessageLogger().

C++ documentation:

Constructs a default QMessageLogger. See the other constructors to specify context information.

pub unsafe fn new_3a(
    file: *const c_char,
    line: c_int,
    function: *const c_char
) -> CppBox<QMessageLogger>
[src]

Constructs a QMessageLogger to record log messages for file at line in function. The is equivalent to QMessageLogger(file, line, function, "default")

Calls C++ function: [constructor] void QMessageLogger::QMessageLogger(const char* file, int line, const char* function).

C++ documentation:

Constructs a QMessageLogger to record log messages for file at line in function. The is equivalent to QMessageLogger(file, line, function, "default")

pub unsafe fn new_4a(
    file: *const c_char,
    line: c_int,
    function: *const c_char,
    category: *const c_char
) -> CppBox<QMessageLogger>
[src]

Constructs a QMessageLogger to record category messages for file at line in function.

Calls C++ function: [constructor] void QMessageLogger::QMessageLogger(const char* file, int line, const char* function, const char* category).

C++ documentation:

Constructs a QMessageLogger to record category messages for file at line in function.

pub unsafe fn warning_0a(&self) -> CppBox<QDebug>[src]

Logs a warning message using a QDebug stream

Calls C++ function: QDebug QMessageLogger::warning() const.

C++ documentation:

Logs a warning message using a QDebug stream

See also qWarning() and QDebug.

pub unsafe fn warning_1a(
    &self,
    cat: impl CastInto<Ref<QLoggingCategory>>
) -> CppBox<QDebug>
[src]

Logs a warning message into category cat using a QDebug stream.

Calls C++ function: QDebug QMessageLogger::warning(const QLoggingCategory& cat) const.

C++ documentation:

Logs a warning message into category cat using a QDebug stream.

See also qCWarning() and QDebug.

Trait Implementations

impl CppDeletable for QMessageLogger[src]

unsafe fn delete(&self)[src]

The QMessageLogger class generates log messages.

Calls C++ function: [destructor] void QMessageLogger::~QMessageLogger().

C++ documentation:

The QMessageLogger class generates log messages.

QMessageLogger is used to generate messages for the Qt logging framework. Usually one uses it through qDebug(), qInfo(), qWarning(), qCritical, or qFatal() functions, which are actually macros: For example qDebug() expands to QMessageLogger(__FILE__, __LINE__, Q_FUNC_INFO).debug() for debug builds, and QMessageLogger(0, 0, 0).debug() for release builds.

One example of direct use is to forward errors that stem from a scripting language, e.g. QML:

void statusChanged(QDeclarativeComponent::Status status) { if (status == QDeclarativeComponent::Error) { foreach (const QDeclarativeError &error, component->errors()) { const QByteArray file = error.url().toEncoded(); QMessageLogger(file.constData(), error.line(), 0).debug() << error.description(); } } }

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.