Skip to content
oneamtu edited this page Nov 30, 2011 · 12 revisions

Practical stuff

To take a log you must:

  1. Have USE_MEMORY set to on when you make cross
  2. If you want to start logging automatically when the robot starts up, then set logging to initialize to true in the constructor in the LoggingBoard class (memory/log/LoggingBoard); if you want to start logging at certain points in the player behavior, call player.brain.logger.startLogging() to start and player.brain.logger.stopLogging() to stop
  3. Copy over the entire ~/naoqi/log folder off the robot into a local directory
  4. Use the qtool and browse for the directory; double clicking on it should open the log for viewing

How it works

The way we manage logging in man is by associating each Memory Object (MObject) with a Logger object. The Logger then has the duty to log the information in the Memory Object in some way. These associations are maintained in a LoggingBoard object (Think of it as a map between each MObject and its Logger). In turn each Logger is associated with an OutProvider, which provider a destination for the logger to output its data to. This separates the logging mechanism itself from the final destination, so a Logger doesn't care if its destination is local (the robot) or remote (wireless), and the OutProvider doesn't care how the information it's being given is packaged.

When a Logger object is created is it then subscribed to its associated Memory Object, so whenever a Memory Object gets updated, its associated Logger will log. It can also be done manually by calling LoggingBoard::log(MObject_ID); with a valid MObject_ID.

Clone this wiki locally