[GitHub] trafficserver pull request #1420: Improve error message for custom log field...

2017-02-15 Thread SolidWallOfCode
Github user SolidWallOfCode closed the pull request at:

https://github.com/apache/trafficserver/pull/1420


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] trafficserver pull request #1420: Improve error message for custom log field...

2017-02-13 Thread SolidWallOfCode
Github user SolidWallOfCode commented on a diff in the pull request:

https://github.com/apache/trafficserver/pull/1420#discussion_r100805070
  
--- Diff: proxy/logging/LogBuffer.cc ---
@@ -615,10 +618,14 @@ LogBuffer::resolve_custom_entry(LogFieldList 
*fieldlist, char *printf_str, char
 }
 
 bytes_written += res;
-field = fieldlist->next(field);
+lastField = field;
+field = fieldlist->next(field);
   } else {
 Note("There are more field markers than fields;"
- " cannot process log entry");
+ " cannot process log entry '%.*s'. Last field = '%s' 
printf_str='%s' pos=%d/%d count=%d alt_printf_str='%s'",
+ bytes_written, write_to, lastField == nullptr ? "*" : 
lastField->symbol(),
--- End diff --

Yes. Which is why there is a check for that case.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] trafficserver pull request #1420: Improve error message for custom log field...

2017-02-07 Thread zwoop
Github user zwoop commented on a diff in the pull request:

https://github.com/apache/trafficserver/pull/1420#discussion_r99900589
  
--- Diff: proxy/logging/LogBuffer.cc ---
@@ -615,10 +618,14 @@ LogBuffer::resolve_custom_entry(LogFieldList 
*fieldlist, char *printf_str, char
 }
 
 bytes_written += res;
-field = fieldlist->next(field);
+lastField = field;
+field = fieldlist->next(field);
   } else {
 Note("There are more field markers than fields;"
- " cannot process log entry");
+ " cannot process log entry '%.*s'. Last field = '%s' 
printf_str='%s' pos=%d/%d count=%d alt_printf_str='%s'",
+ bytes_written, write_to, lastField == nullptr ? "*" : 
lastField->symbol(),
--- End diff --

Hmmm, maybe it's completely unrealistic, but couldn't lastField be NULL 
here ? 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] trafficserver pull request #1420: Improve error message for custom log field...

2017-02-06 Thread SolidWallOfCode
GitHub user SolidWallOfCode opened a pull request:

https://github.com/apache/trafficserver/pull/1420

Improve error message for custom log field mismatch.



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/SolidWallOfCode/trafficserver 
i-agree-with-phil-2

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/trafficserver/pull/1420.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1420






---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---