file and debug info all in one place?

Amex Amex at gmail.com
Sun May 26 17:45:46 UTC 2019


On Saturday, 25 May 2019 at 19:54:28 UTC, user1234 wrote:
> On Saturday, 25 May 2019 at 19:29:25 UTC, Amex wrote:
>> __FILE__, __LINE__, etc...
>>
>> we have to use these as template parameters
>>
>> Why not just make every function have this info available in a 
>> "hidden" struct? No need to mess around with any extra 
>> bloating of the function signature.
>
> rather log when you enter a function, this will be more simple 
> in your case
>
> enum lg =
> `writeln(__FILE_FULL_PATH, "(", __LINE__, "): enter", 
> __PRETTY_FUNCTION__);`;
>
> and put
>
>     mixin(lg);
>
> in your functions.
>
> or use std.experimental.logger which does more or less the same 
> when you just log() without supplemental args.


No, this won't get the the callee's info....



More information about the Digitalmars-d mailing list