[.......*1......*..2....*....3..*......4*.......*5......*..6....*....7..*......] This is the System Console 1.0§, for the BeOS dr8 (c) by Benoit TRIQUET , release of the 28/10/96 I retain full copyright on this program, library and source code, but allow redistribution of THIS archive provided it's unmodified and free of charge. I MEAN IT, FREE AT ALL, no "media duplication" or "handling" cost allowed ! ie. you can put it on your ftp or www site. Bundles and cover disks are not allowed as well. You are allowed to change the code for your own needs, but you are not allowed to reuse it in anything you distribute without my approval, nor redistribute modified archives of System Console 1.0§. Please submit your bugfixes or changes directly to me :-) This little tool is meant as a monitoring and debugging tool (those with a Unix background will recognize it :) Suggested use ------------- - monitoring servers and daemons : these are not supposed to raise alert boxes or any kind of window, but nevertheless can have something to say to the user, especially when they do report errors in message replies, but the client app doesn't handles them... :-) - debugging : debug any application that you can't launch from a terminal without having to loop serial4 tx line to rx and pop Connect :-) in fact I use SysCon to debug apps i can't run in the MW debugger because they are Launch()'ed, and it's also convenient when you have parts of your code in shared libs because even if you have the source code and xSYM file the MW debugger can't trace in the shared library's code. There is also that situation where you want to trace a bug in your startup code when the app gets an on-launch RefsReceived message, ie. there again you can't launch it from a Terminal. Installation ------------ Untar'n'gzip the archive where you want and read about using the libSysCon.so. System Console v1.0§ doesn't require anything besides libbe.so. Using SysCon ------------ You can launch it from the Browser or a Terminal, or from your UserBootscript. The main menu : About SysCon : guess what... Log to file : if checked, every message sent to SysCon is also written to a file named system log in the directory where is the SysCon file. You can toggle this option. The file is never emptied. Show window on new message : if checked, the window will be shown when a message arrives, if it was hidden. Activate window on new message : if checked, the window will be activated when a message arrives. Beep on new message : if checked, find yourself ! Hide window/Show window : hide or show the window (the only way to show it again once you hidden it or pressed its close gadget). Quit SysCon : useless, because you will want it to run from dusk till dawn ! The window : Edit->Copy : copy the selected message to the clipboard. Edit->Clear : clear the window (but not the log file). Window->Snap window frame : "remembers" the window frame rectangle Window->Restore snapped frame : move and resize the window to the last snapped frame. Special->Reboot (quit zoo_keeper) : this will force a database+filesystem shutdown, so that you won't have a database reindexing when rebooting, but be careful, the applications that are running are not given a chance to quit properly, so if you corrupt your files or lose data, i'm not responsible :-) The last snapped position is saved in a file called SysCon prefs, in the directory where SysCon resides. You can't change this name, nor have multiple pref files, and the main menu settings are not saved. When you launch again SysCon, the window is opened at the saved position, unless it doesn't intersect with the current screen's frame rectangle. Be careful in that case, if you do a Command-R, you'll lose the window... I don't bother handling stupid situations :-) You cannot select multiple messages at a time but you can drag'n'drop from the window to any BTextView. Command-C works too. The memory gauge is updated if necessary every 0.5 s. The little icons are hardcoded. So is the log file name and path :-) There are missing features, like a complete preferences handling, but so far no known bug. Using the System Console from your programs ------------------------------------------- You can : - send the following message : what = 'SCpm' or SYSCON_PRINT_MESSAGE, field "message", B_STRING_TYPE, with the text to display (it can have \n to separate lines, and a \n will be added if necessary in the log file. field "status", B_LONG_TYPE, with values 0, 1, 2 or SYSCON_INFO, SYSCON_WARNING, SYSCON_ERROR to get the good icon, according to the kind of message conveyed. The signature of System Console v1.0§ is 'SysC'. - use the libSysCon : You have a shared library, libSysCon.so, that you can put in your /system/lib or besides the program that want to use it, and in (Objects), if you recompile the libSysCon.¹ project, an object file that you can move and add to a CW project (you can also add a path to the SystemConsole folder and you can also use the .cpp file if you want). Everything is declared in libSysCon.h that you can move to /boot/develop/headers or to your CW project folder or you add a path in the project settings. The API is quite simple : long SysConPrintVA( long type, const char *fmt, va_list arg ); long SysConPrint( long type, const char *fmt, ... ); long SysConPrintInfo( const char *fmt, ... ); long SysConPrintWarning( const char *fmt, ... ); long SysConPrintError( const char *fmt, ... ); I don't think it needs an explanation, basically everything works like a dumb printf ! Note that the Be classes'PrintToStream() methods won't work because they still write to stdout. There is a test program, t.cpp. Compile it with "mwcc t.cpp -lSysCon". Well, that's all !