Project

General

Profile

Actions

Feature #2556

closed

Logging macro for function tracing

Added by Davide Pesavento almost 10 years ago. Updated almost 10 years ago.

Status:
Rejected
Priority:
Normal
Category:
Core
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:

Description

Add a macro that uses __func__ to trace function execution.

Actions #1

Updated by Davide Pesavento almost 10 years ago

  • Status changed from In Progress to Code review
  • % Done changed from 0 to 100
Actions #2

Updated by Junxiao Shi almost 10 years ago

Please justify the necessity of this feature.

commit:3dc9b6b2ee96d22a7455dc3b35e27ac7acf72acd has

#define NFD_LOG_TRACE_FUNC()      NFD_LOG_TRACE(__func__)

This doesn't appear useful, because it doesn't log the arguments.

Actions #3

Updated by Davide Pesavento almost 10 years ago

I don't care about the arguments, I just want to see when a function gets called, therefore this definition is enough. Feel free to submit an alternative design with arguments logging.

Actions #4

Updated by Junxiao Shi almost 10 years ago

Please justify the necessity of this feature.

Merely knowing a function is called is not useful. It's more useful to:

  • show some of the arguments (example)
  • show the decision made by the function (example)
Actions #5

Updated by Davide Pesavento almost 10 years ago

I don't know how you can judge whether something is useful or not for someone else. But let's assume you have the power of divination for a moment. Still, knowing exactly if and when a function gets called is more than enough for a lot of debugging scenarios I've encountered.

Anyway, if you don't want this macro, I'll just copy the code wherever I need it. I thought code duplication was bad...

Actions #6

Updated by Junxiao Shi almost 10 years ago

NFD_LOG_TRACE_FUNC() isn't necessarily better than NFD_LOG_TRACE(__func__) when it appears in a function.

Actions #7

Updated by Davide Pesavento almost 10 years ago

Great. I'll do that then. Reject this feature please (redmine doesn't let me)

Actions #8

Updated by Junxiao Shi almost 10 years ago

  • Status changed from Code review to Rejected
Actions

Also available in: Atom PDF