EIPStackGroup / EIPStackGroup/OpENer

Can't easily use tracing when building OpENer as library.

Open
#547 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
857
Forks
314
Avg merge
18d 2h
Merged PRs (30d)
1

Description

Hi there, I have ran into a bit of an issue with trying to use tracing when building OpENer as a library.

When building as a library trace.h will not include "opener_user_conf.h"

#ifndef OPENER_INSTALL_AS_LIB
#include "opener_user_conf.h"
#endif

However this is where the definition for LOG_TRACE is provided. So if you build it as a library and try and turn tracing on by defining OPENER_TRACE_ENABLED it will fail to compile.

I understand LOG_TRACE is likely provided in openuser_conf.h as it allows users to extend the functionality of the trace macro if they so desire.

My suggestion is that that trace.h contains a default definition of #define LOG_TRACE(...) fprintf(stderr,__VA_ARGS__) that is wrapped inside of an #ifndef LOG_TRACE to still allow user definition. Much the same as how OPENER_TRACE_LEVEL has been handled.

```
/* Defines a default trace function if the user hasn't provided one */
#ifndef LOG_TRACE
#include
#define LOG_TRACE(...) fprintf(stderr,__VA_ARGS__)
#endif
```

Thanks.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.