tree: d51178d338f5cb95d5ffeb952b7435d38fa343ba [path history] [tgz]
  1. Sample/
  2. src/
  3. .gitignore
  4. BeDC.h
  6. screenshot.png

Dev Console

Written by Adrien Destugues Based on BeDC by Magnus Landahl

This program is distributed under the terms of the MIT license.

What is it

This application receives messages from other application and display them in a nicely formatted view. This is useful in several cases:

  • If your application does not normally run from a Terminal (for example, it is a system service), making it unpractical to access its standard output
  • If your application uses the terminal for other things than debug logs
  • If you have multiple applications that talk to each other and all of them need to emit logs

There is room for improvements, such as providing easy copypaste of data, search and filtering functions, etc.

How to use

All you have to do is to create an BeDC object and use that one to send messages. It´s that simple. An quick example:

BeDC dc;
dc.SendMessage("It just works!!!");

First some defines: Colors:

White	 			= DC_WHITE
Black 			= DC_BLACK
Blue 				= DC_BLUE
Red 				= DC_RED
Yellow 			= DC_YELLOW
Green 			= DC_GREEN

Message types:

Normal message 		= DC_MESSAGE
Success message	= DC_SUCCESS
Error message 		= DC_ERROR

The constructor:

BeDC(const char *name, int8 color);

'name' is the display name, it could be what ever you want. Default is: "Application" 'color' is the color of the head. If you don´t specify a color BeDC will use the defaut head color.

Member functions:

SendMessage(char *text, int8 type);

Sends a normal message.


Adds a separator.

SendInt(Int32 / Int64 integer, const char *description, int8 type);

Sends an int32 or int64. If you don´t specify a description BeDC will print "Integer"

SendPoint(BPoint point, const char *description, int8 type);

Sends a BPoint. If you don´t specify a description BeDC will print "Point"

SendRect(BRect rect, const char *description, int8 type);

Sends a BRect. If you don´t specify a description BeDC will print "Rectangle"

SendFormat(const char *text, ...);
SendFormatT(const char *text, int8 type, ...);

Sends a format string like printf. SendFormatT is used when you want to specify the message type.

DumpBMessage(BMessage *Message, const char *desc = "", int8 type = DC_MESSAGE);

Dumps a BMessage...