官术网_书友最值得收藏!

Tracing with the notifier

The OSG notifier mechanism provides a novel method of outputting verbose debugging messages, either from the OSG rendering backend or from the user level. It is really an important and time-honored method for tracing and debugging programs. In addition, the notifier is also used throughout the OSG core functionalities and plugins to show errors, warning messages, or information about the work in progress. Developers may simply insert debugging print functions liberally in the source code files. The print function, osg::notify(), is designed to accept different levels of messages and send them to the console or user-defined controllers.

The osg::notify() function can be used as the standard output stream std::cout. It requires a NotifySeverity argument to indicate the message level, which can be ALWAYS, FATAL, WARN, NOTICE, INFO, DEBUG_INFO, and DEBUG_FP, sorted from the most severity to the least. For instance:

osg::notify(osg::WARN) << "Some warn message." << std::endl;

This will print out a line of the warning message by default. Here osg::WARN is used to indicate the notify level to the OSG notifier system.

A series of macro definitions, such as OSG_FATAL, OSG_WARN, and OSG_NOTICE, will do the same work as the osg::notify() function, with different severity levels.

主站蜘蛛池模板: 女性| 景宁| 宁晋县| 琼结县| 民勤县| 手游| 西贡区| 客服| 合江县| 宜章县| 襄樊市| 平阴县| 蒙城县| 象山县| 澳门| 高青县| 介休市| 毕节市| 许昌市| 大田县| 大厂| 从化市| 大石桥市| 台中市| 隆回县| 兴安盟| 株洲市| 星座| 龙里县| 无锡市| 红原县| 中阳县| 巴林右旗| 隆回县| 自贡市| 抚顺市| 阿拉善右旗| 砚山县| 西乌珠穆沁旗| 浏阳市| 定安县|