Skip to content

Commit 70ecda9

Browse files
committed
cosmit
1 parent 0875bab commit 70ecda9

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

qmetaobject/src/log.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ cpp_class!(
1616
/// Wrapper for Qt's QMessageLogContext
1717
pub unsafe struct QMessageLogContext as "QMessageLogContext"
1818
);
19+
1920
impl QMessageLogContext {
2021
// Return QMessageLogContext::line
2122
pub fn line(&self) -> i32 {
@@ -72,12 +73,6 @@ pub enum QtMsgType {
7273
// QtSystemMsg = QtCriticalMsg
7374
}
7475

75-
/// Wrap qt's qInstallMessageHandler.
76-
/// Useful in order to forward the log to a rust logging framework
77-
pub fn install_message_handler(logger: extern "C" fn(QtMsgType, &QMessageLogContext, &QString)) {
78-
cpp!(unsafe [logger as "QtMessageHandler"] { qInstallMessageHandler(logger); })
79-
}
80-
8176
/// Mapping from Qt logging levels to Rust logging facade's levels.
8277
///
8378
/// Due to the limited range of levels from both sides,
@@ -138,6 +133,12 @@ impl From<Level> for QtMsgType {
138133
}
139134
}
140135

136+
/// Wrap qt's qInstallMessageHandler.
137+
/// Useful in order to forward the log to a rust logging framework
138+
pub fn install_message_handler(logger: extern "C" fn(QtMsgType, &QMessageLogContext, &QString)) {
139+
cpp!(unsafe [logger as "QtMessageHandler"] { qInstallMessageHandler(logger); })
140+
}
141+
141142
// Logging middleware, pass-though, or just proxy function.
142143
// It is called from Qt code, then it converts Qt logging data
143144
// into Rust logging facade's log::Record object, and sends it

0 commit comments

Comments
 (0)