@@ -16,6 +16,7 @@ cpp_class!(
16
16
/// Wrapper for Qt's QMessageLogContext
17
17
pub unsafe struct QMessageLogContext as "QMessageLogContext"
18
18
) ;
19
+
19
20
impl QMessageLogContext {
20
21
// Return QMessageLogContext::line
21
22
pub fn line ( & self ) -> i32 {
@@ -72,12 +73,6 @@ pub enum QtMsgType {
72
73
// QtSystemMsg = QtCriticalMsg
73
74
}
74
75
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
-
81
76
/// Mapping from Qt logging levels to Rust logging facade's levels.
82
77
///
83
78
/// Due to the limited range of levels from both sides,
@@ -138,6 +133,12 @@ impl From<Level> for QtMsgType {
138
133
}
139
134
}
140
135
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
+
141
142
// Logging middleware, pass-though, or just proxy function.
142
143
// It is called from Qt code, then it converts Qt logging data
143
144
// into Rust logging facade's log::Record object, and sends it
0 commit comments