A developer console to log messages from other applications. The messages are sent using a simple BMessage based protocol.

Clone this repo:

Branches

  1. 768645a Implement cut and copy by PulkoMandy · 9 months ago main
  2. ee68b1e Add menus (not all wired yet) and about window by PulkoMandy · 10 months ago
  3. 9e78086 Improve formatted strings sending by PulkoMandy · 10 months ago
  4. bff0dda Add a screenshot with logs from the demo app by PulkoMandy · 11 months ago
  5. 9d65854 Markdownify and update the README by PulkoMandy · 11 months ago

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.

SendSeparator();

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...