Logging

Posted by Alyce on Fri 26 Aug 2016 04:54 AM — 3 posts, 17,008 views.

#0
I know that certain commands show an online log when used..

example:

vassign returns

Log:vassign



I added a mpmset program to allow mobs to set questpoints via mobprog and I want that logged specifically so I can see it as it occurs in game.

as a work-around I am using progbug to display it.. but I would rather it show up as BUILD: or LOG:

here is what i got going on...

if( !str_cmp( arg2, "train" ))
{
if( value > 0 )
{
progbug( "giving training points via prog", ch);
victim->pcdata->quest_curr += value;
return;
}
}

in a perfect world I would like to be in game and have it say:

LOG: Giving training points via prog, Mob #1200.

instead of the current

Log: [*****] BUG: giving training points via prog, Mob #1200.


any ideas?
USA Global Moderator #1
Please put [code]..[/code] tags around chunks of code in the forum.

Poking through the SMAUG code at https://github.com/nickgammon/smaugfuss/blob/master/src/db.c ...

Maybe try using something like this?

log_printf_plus( LOG_BUILD, LEVEL_LOG,  "giving training points via prog, Mob #%d.", ch->pIndexData ? ch->pIndexData->vnum : 0);


Note, I see the progbug function does a check for supermob status which I'm clearly not doing here.
Amended on Fri 26 Aug 2016 02:22 PM by Fiendish
#2
Thank you for the speedy response! Sorry about the code tags. I got it working like I want to :)