wiki:HaikuBook/LegacyNetworkKit/BNetDebug

ApiClass(name=BNetDebug,base=,derived=) Collection of convenience methods for debugging network operations.

The static members of this class can be used to print various messages to the standard output.

Debugging can be turned on and off by using the ApiLinker(Enable()) method. This way you don't have to remove the debugging statements in production code.

By default, debugging is turned off.

Static Functions

ApiDeclareMethod(id=class_b_net_debug_1acf56301eead85a073062d2847c98b753, type=void, name=Enable, argsstring=(bool), const=no, virtual=non-virtual, params=[{"defval": ""\, "type": "bool"\, "name": "enable"}]) Enable or disable debugging.

Use this method to actually print the debug messages to the command line.

Parameters
enablePass true to enable debugging, or false to disable it.

ApiDeclareMethod(id=class_b_net_debug_1af30236ab764d9f0dffeeb7e42ed10da0, type=bool, name=IsEnabled, argsstring=(), const=no, virtual=non-virtual, params=[]) Check if debugging is enabled.

Returns
true if debugging is disabled, or false if it is not.

ApiDeclareMethod(id=class_b_net_debug_1acb183ec5263c5fec50878514108e4430, type=void, name=Print, argsstring=(const char *msg), const=no, virtual=non-virtual, params=[{"defval": ""\, "type": "const char *"\, "name": "msg"}]) Print a pre-formatted message to the standard error output.

Output will be of the format:

debug: <msg>\n

Note:

  • there will always be a trailing newline, whether there is one in the original message or not.
  • if debugging is not enabled, the message will not be printed.
Parameters
msgThe message that is printed to stderr.

ApiDeclareMethod(id=class_b_net_debug_1a4b01704ebf8aba2d1d5b60981dfa9c0b, type=void, name=Dump, argsstring=(const char *data&#44; size_t size&#44; const char *title), const=no, virtual=non-virtual, params=[{"defval": ""\, "type": "const char *"\, "name": "data"}\, {"defval": ""\, "type": "size_t"\, "name": "size"}\, {"defval": ""\, "type": "const char *"\, "name": "title"}]) Dump a set of raw data into hex and ASCII to the standard error output.

Note:

  • There will always be a trailing newline, whether there is one in the original message or not.
  • If debugging is not enabled, the message will not be printed.
Parameters
dataA pointer to the data buffer. If NULL is passed then the output is undefined!
sizeThe number of bytes to print from the buffer.
titleThe title that should be printed in the output. If NULL is passed then the output is undefined!
Last modified 12 years ago Last modified on Nov 25, 2012, 2:46:11 PM
Note: See TracWiki for help on using the wiki.