Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/1593 add fields to logs #1596

Merged
merged 10 commits into from
Dec 4, 2015
Merged

Conversation

fgalan
Copy link
Member

@fgalan fgalan commented Dec 3, 2015

Implements #1593

@@ -343,6 +343,9 @@ int inSigHandler = 0;
char* progName; /* needed for messages (and by lmLib) */
char progNameV[512]; /* where to store progName */
__thread char transactionId[64] = "N/A";
__thread char srv[50 + 1] = "N/A"; // FIXME: Maybe we should use limits.h ?
__thread char subsrv[51*10 +1] = "N/A"; // FIXME: Maybe we should use limits.h ?
__thread char from[4*4 + 1] = "N/A"; // Based in XXX.XXX.XXX.XXX

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

srv ... I would prefer to write out the name "service", not especially long.
And, these names are very generic and need either to be static or have a prefix.
I guess static would be enough.

About 'from', it doesn't say much. Perhaps peerIp or clientIp would be more descriptive ?

About the default value, I'd leave it as is.
I really don't want any dependencies of common-lib in logMsg (which is a lower level library).

Now, about from[4 * 4 + 1]: just put 16, 4 * 4 + 1 is not even correct ...
Or, add a definition of NUMERICAL_IP_MAX_SIZE as 15 and then use NUMERICAL_IP_MAX_SIZE + 1.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The names of the variables came after the names that Operaions have defined for the fields of the log.

srv= ... | subsrv= ... | from= ...

I think that having the same name will help to identify the purpose of each variable.

I'll move limits to limit.h

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand your point, however, logMsg is a generic library.
srv ... server?
In contextBroker.cpp we would have the string "srv=SERVICE", which is OK, as it is specific for the broker, but lmLib ... is not. We need to discuss this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, no problem.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 7b4270c

@@ -304,13 +304,6 @@ extern int noOfRtUnsubscribeContextResponse;
extern int noOfRtSubscribeResponse;
extern int noOfRtSubscribeError;

/*
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Old leftover, spotted in this PR.

NTC

@kzangeli
Copy link
Member

kzangeli commented Dec 4, 2015

LGTM

@fgalan
Copy link
Member Author

fgalan commented Dec 4, 2015

Ready to merge... when jenkins finishes.

kzangeli pushed a commit that referenced this pull request Dec 4, 2015
@kzangeli kzangeli merged commit 6bca41e into develop Dec 4, 2015
@kzangeli kzangeli deleted the feature/1593_add_fields_to_logs branch December 4, 2015 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants