[−][src]Struct qt_core::QMessageLogger
The QMessageLogger class generates log messages.
C++ class: QMessageLogger
.
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
.
pub unsafe fn critical_1a(
&self,
cat: impl CastInto<Ref<QLoggingCategory>>
) -> CppBox<QDebug>
[src]
&self,
cat: impl CastInto<Ref<QLoggingCategory>>
) -> CppBox<QDebug>
Logs a critical message into category cat using a QDebug stream.
Calls C++ function: QDebug QMessageLogger::critical(const QLoggingCategory& cat) const
.
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
.
pub unsafe fn debug_1a(
&self,
cat: impl CastInto<Ref<QLoggingCategory>>
) -> CppBox<QDebug>
[src]
&self,
cat: impl CastInto<Ref<QLoggingCategory>>
) -> CppBox<QDebug>
Logs a debug message into category cat using a QDebug stream.
Calls C++ function: QDebug QMessageLogger::debug(const QLoggingCategory& cat) const
.
pub unsafe fn info_0a(&self) -> CppBox<QDebug>
[src]
Logs an informational message using a QDebug stream.
Calls C++ function: QDebug QMessageLogger::info() const
.
pub unsafe fn info_1a(
&self,
cat: impl CastInto<Ref<QLoggingCategory>>
) -> CppBox<QDebug>
[src]
&self,
cat: impl CastInto<Ref<QLoggingCategory>>
) -> CppBox<QDebug>
Logs an informational message into the category cat using a QDebug stream.
Calls C++ function: QDebug QMessageLogger::info(const QLoggingCategory& cat) const
.
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()
.
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]
file: *const c_char,
line: c_int,
function: *const c_char
) -> CppBox<QMessageLogger>
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)
.
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]
file: *const c_char,
line: c_int,
function: *const c_char,
category: *const c_char
) -> CppBox<QMessageLogger>
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)
.
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
.
pub unsafe fn warning_1a(
&self,
cat: impl CastInto<Ref<QLoggingCategory>>
) -> CppBox<QDebug>
[src]
&self,
cat: impl CastInto<Ref<QLoggingCategory>>
) -> CppBox<QDebug>
Logs a warning message into category cat using a QDebug stream.
Calls C++ function: QDebug QMessageLogger::warning(const QLoggingCategory& cat) const
.
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()
.
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
impl RefUnwindSafe for QMessageLogger
impl Send for QMessageLogger
impl Sync for QMessageLogger
impl Unpin for QMessageLogger
impl UnwindSafe for QMessageLogger
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> CastInto<U> for T where
U: CastFrom<T>,
[src]
U: CastFrom<T>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> StaticUpcast<T> for T
[src]
unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,