Page 1 of 1

self::debug(""); + self::dump();

Posted: 06 October 2020, 19:37
by developgame
I am having difficulty locating my traces in BGArequest&SQL_logs

In my game.php I have

foreach ($this->main_chambers as $x => $x_value )
{
$draw_pile[] = array('type' => $x, 'type_arg' => 1, 'nbr'=>2);
}
self::debug("ahh");
self::dump( ' draw deck' , $draw_pile );

When I run the game and check the BGArequest&SQL_logs, I cannot never see my traces.
Any suggestions where I could find them?

Thanks for any help!

Re: self::debug(""); + self::dump();

Posted: 06 October 2020, 21:56
by Victoria_La
where in the game.php do you put it? If it is in contructor you may never see it.
I suggest to put self:warn("Something") it will be in error log, if not - method you putting it cannot log.
For trace log I usually do
self::dump( '*********************************************************** draw deck' , $draw_pile );
so you can see stars better, you can increse number of lines in the outout on that page too

Re: self::debug(""); + self::dump();

Posted: 07 October 2020, 18:38
by developgame
Thanks for your reply Victoria_La.

I put the trace messages in function setupNewGame

I will try self::warn(" ")

Re: self::debug(""); + self::dump();

Posted: 07 October 2020, 21:53
by Victoria_La
I don't think logging works in setupNewGame. If you need to debug it I suggest to left this method as default,
create another method, i.e. setupNewGameDebug and call this method directly from message chat window to initialize db, and loggging should work at this point

Re: self::debug(""); + self::dump();

Posted: 11 October 2020, 20:07
by developgame
Thanks Victoria!

Creating another method outside setup sounds like a brilliant idea!