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

Game development with Board Game Arena Studio
Post Reply
User avatar
developgame
Posts: 107
Joined: 15 June 2020, 20:56

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

Post 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!
User avatar
Victoria_La
Posts: 665
Joined: 28 December 2015, 20:55

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

Post 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
User avatar
developgame
Posts: 107
Joined: 15 June 2020, 20:56

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

Post by developgame »

Thanks for your reply Victoria_La.

I put the trace messages in function setupNewGame

I will try self::warn(" ")
User avatar
Victoria_La
Posts: 665
Joined: 28 December 2015, 20:55

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

Post 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
User avatar
developgame
Posts: 107
Joined: 15 June 2020, 20:56

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

Post by developgame »

Thanks Victoria!

Creating another method outside setup sounds like a brilliant idea!
Post Reply

Return to “Developers”