Skip to content

Replace eprintln! with logging #96

Open
@ratijas

Description

@ratijas

There is a call to eprintln! macro within singleton registration callback. It seems like a good place for logging frameworks instead. We could use error! from the Rust logging facade or qFatal from Qt + cpp! side. Since rust logging facade is feature-flagged, probably calling Qt would make more sense, or feature-flag double-implementation to avoid round-trips when rust logging is enabled.

Err(_panic) => {
eprintln!("qml_register_singleton_type T::default or T::init panicked.");
std::process::abort()
}


By the way,

  • qCritical (citing) "exits if the environment variable QT_FATAL_CRITICALS is not empty", and
  • qFatal (citing) "using the default message handler this function will abort to create a core dump".

I don't remember implementing aborts in rust message handler in #86 🤔

Metadata

Metadata

Assignees

Labels

A-rustArea: Rust glueC-enhancementCategory: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Experience needed to fix: Easy / not muchP-lowLow priority

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions