How to enable error logging to the hb_out.log file?

202 views
Skip to first unread message

2tict...@gmail.com

unread,
Nov 4, 2023, 7:35:34 PM11/4/23
to Harbour Users
Hi.
How to enable error logging to the hb_out.log file? I am compiling on Debian linux using hbmk2 with *.hbp file. Harbour version: 3.2.0dev (r2023-04-21 11:01). Error does not create log file.
Best regards, Dmian

Alain Aupeix

unread,
Nov 5, 2023, 3:02:50 AM11/5/23
to harbou...@googlegroups.com, 2tict...@gmail.com

I don't know how you build harbour.

By my side, I use these commands :

make 2>&1                          |tee -a harbour.log
sudo -E make install 2>&1   |tee -a harbour.log

A+
--

Alain Aupeix
Sites web : JujuLand | Pissobi-Lacassagne | Gadel
X.ubuntu 16.04 | H.arbour 3.2.0-1 (r2023-07-07 00:07) | Hw.gui 2.23-5dev (r3340) | G.ramps 5.1.2


Damian Sz.

unread,
Nov 5, 2023, 11:09:55 AM11/5/23
to Harbour Users
Thank you Alain
 I'm talking about program execution errors, not compilation errors. I do exactly as you wrote. I redirect stderr to a file e.g. ./myprog 2> hb_out.log. I know that Harbour error handling does this automatically. When a program is compiled by hbmk2 myprog.prg then the runtime error creates the hb_out.log file but when the program is compiled by hbmk2 myproject.hbp the runtime errors do not create the hb_out.log file.

Damian

Alain Aupeix

unread,
Nov 5, 2023, 1:03:12 PM11/5/23
to harbou...@googlegroups.com, Damian Sz.
Le 05/11/2023 à 17:09, Damian Sz. a écrit :
Thank you Alain
 I'm talking about program execution errors, not compilation errors. I do exactly as you wrote. I redirect stderr to a file e.g. ./myprog 2> hb_out.log.
ok, but the solution using tee has the advantage to display the output during the compilation and install

I know that Harbour error handling does this automatically. When a program is compiled by hbmk2 myprog.prg then the runtime error creates the hb_out.log file but when the program is compiled by hbmk2 myproject.hbp the runtime errors do not create the hb_out.log file.

I must say that I don't have this problem, as I use hwgui, and I compil my progs with HwMake (which also handles pure harbour programs), and this tools don't use hbmk2, but harbour and gcc.

https://sourceforge.net/projects/hwmake/

Takács Gábor

unread,
Nov 5, 2023, 1:14:41 PM11/5/23
to harbou...@googlegroups.com
HI
The hb_out.log is very rarely created, I don't even pay attention to it.
Instead, the
I use xhb_ErrorLog("ERROR.TXT", .F.) function which should be called once while main() is running, and then for each error it creates a file with the current error, SET status, etc.
append the source xhb_ErrorLog() \contrib\xhb\xhberr.prg to the .hbmk.

--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/76715605-373a-8da0-4c3c-1ad8484fde67%40wanadoo.fr.

Damian Sz.

unread,
Nov 6, 2023, 4:40:04 AM11/6/23
to Harbour Users
Thank you Alain and Takacs. Your suggestions were very helpful.
Reply all
Reply to author
Forward
0 new messages