Anyone have any recommendations on a low overhead way to log all of the output of an engine to a file each time you run the engine? My engine is in ANSI C, so would be interested in source code or suggestions related to that language.
Is there a engine anyone knows of written in C that logs to a file? I will be glad to take a look at the source and figure it out.
Thanks for any information.
Jeff
Logging
Moderators: hgm, Rebel, chrisw
-
- Posts: 1334
- Joined: Sun Jul 17, 2011 11:14 am
Re: Logging
You could use xboard -debug if your engine is xboard protocol, and I believe polyglot has a logging function, too.jsgroby wrote:Anyone have any recommendations on a low overhead way to log all of the output of an engine to a file each time you run the engine? My engine is in ANSI C, so would be interested in source code or suggestions related to that language.
Is there a engine anyone knows of written in C that logs to a file? I will be glad to take a look at the source and figure it out.
Thanks for any information.
Jeff
Matthew:out
Some believe in the almighty dollar.
I believe in the almighty printf statement.
I believe in the almighty printf statement.
-
- Posts: 27808
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Logging
Usually one lets the GUI take care of this.
-
- Posts: 7220
- Joined: Mon May 27, 2013 10:31 am
Re: Logging
By the way do you know how to play ultra short games using winboard. Then I don't need to see the GUI but only the result of the match.hgm wrote:Usually one lets the GUI take care of this.
-
- Posts: 27808
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Logging
The easiest way to not see the GUI is to minimize the window.
There is a command-line option -noGUI, which suppresses the board and icon update during the game. When you use that the round-trip delay for engine-GUI traffic should reduce to around 1 msec, which should be low enough to play very fast games. (Keep in mind that when you use standard functions to let the engine read the time, the accuracty is only 16 msec.) If you don't need extremely fast play (i.e. down to 10 sec/game), allowing the GUI update is usually not a problem, however, as long as you don't forget to switch move animation off.
There is a command-line option -noGUI, which suppresses the board and icon update during the game. When you use that the round-trip delay for engine-GUI traffic should reduce to around 1 msec, which should be low enough to play very fast games. (Keep in mind that when you use standard functions to let the engine read the time, the accuracty is only 16 msec.) If you don't need extremely fast play (i.e. down to 10 sec/game), allowing the GUI update is usually not a problem, however, as long as you don't forget to switch move animation off.
-
- Posts: 83
- Joined: Mon Mar 24, 2014 12:26 am
- Location: Glen Carbon, IL USA
Re: Logging
Thanks. I had not really thought out what I was wanting before I posted. With the GUIs (engine is both uci and xboard compatible) I was getting the logs, but I was more concerned about running debug tests and perft and getting that output. Turns out that I can just redirect the output to a file since I am on unix. That way I don't have to put any additional code in that might have an effect on performance.hgm wrote:Usually one lets the GUI take care of this.
Thanks for the answers everyone.
Jeff
-
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
Re: Logging
Crafty has done this forever. For things I want logged, I use a "Print()" procedure that is in Crafty utility.c. It displays output to the display exactly like printf (it uses printf internally) but also directs a copy to a file.. I don't notice enough overhead to even measure, but I have the ability to turn it off should I ever have to write to a device slow enough to cause problems...jsgroby wrote:Anyone have any recommendations on a low overhead way to log all of the output of an engine to a file each time you run the engine? My engine is in ANSI C, so would be interested in source code or suggestions related to that language.
Is there a engine anyone knows of written in C that logs to a file? I will be glad to take a look at the source and figure it out.
Thanks for any information.
Jeff
-
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
Re: Logging
I think he is wanting to log more than what he sends to xboard. For example all my end of search statistics, time used, sometimes debugging output on how many reductions were done by ply and such, etc.hgm wrote:Usually one lets the GUI take care of this.
-
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
Re: Logging
If that is all you want, try this:jsgroby wrote:Thanks. I had not really thought out what I was wanting before I posted. With the GUIs (engine is both uci and xboard compatible) I was getting the logs, but I was more concerned about running debug tests and perft and getting that output. Turns out that I can just redirect the output to a file since I am on unix. That way I don't have to put any additional code in that might have an effect on performance.hgm wrote:Usually one lets the GUI take care of this.
Thanks for the answers everyone.
Jeff
program | tee filename
now output goes to filename AND the display although it can get sort of "chunky" in the way it gets displayed in chunks rather than always being real smooth.
-
- Posts: 83
- Joined: Mon Mar 24, 2014 12:26 am
- Location: Glen Carbon, IL USA
Re: Logging
Perfect. Exactly what I needed. Thank you sir.bob wrote:If that is all you want, try this:jsgroby wrote:Thanks. I had not really thought out what I was wanting before I posted. With the GUIs (engine is both uci and xboard compatible) I was getting the logs, but I was more concerned about running debug tests and perft and getting that output. Turns out that I can just redirect the output to a file since I am on unix. That way I don't have to put any additional code in that might have an effect on performance.hgm wrote:Usually one lets the GUI take care of this.
Thanks for the answers everyone.
Jeff
program | tee filename
now output goes to filename AND the display although it can get sort of "chunky" in the way it gets displayed in chunks rather than always being real smooth.
Jeff