Conversation
Especially fix setup-app-layer script to not forget this part
|
|
||
| /// populate a json object with transactional information, for logging | ||
| fn log(tx: &ModbusTransaction, js: &mut JsonBuilder) -> Result<(), JsonError> { | ||
| js.open_object("modbus")?; |
There was a problem hiding this comment.
- What is the right way to do this ?
open the object at the start of the logging function, or should the caller do that ?
Now, half the protocols do one way, and the other half does the other way
This PR makes it that the caller opens the object
There was a problem hiding this comment.
I wouldn't say there is a right way, but we want to avoid empty objects, or even the overhead of empty objects. So I think the caller should only open the object if it knows it will contain data. If its the logging function that decides whether logging will happen or not, maybe it should open the object, to avoid the case where the caller would have the rewind to a marker.
There was a problem hiding this comment.
The way you put it, it looks better to open in the logging function which knows better if the object is empty
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #9005 +/- ##
==========================================
- Coverage 82.40% 82.30% -0.10%
==========================================
Files 969 969
Lines 273608 273462 -146
==========================================
- Hits 225469 225081 -388
- Misses 48139 48381 +242
Flags with carried forward coverage won't be shown. Click here to find out more. |
|
Information: QA ran without warnings. Pipeline 14375 |
Would it makes sense to do that as a separate issue? Could even wait for 8 as its not needed write now. Otherwise I like what I'm seeing with all this cleanup. |
|
Replaced by #9034 |
Link to redmine ticket:
None, preliminary work for https://redmine.openinfosecfoundation.org/issues/5053 and app-layer plugins
Part of #8961 with rebase
Describe changes:
After that, there is still from #8961
SimpleTxLogFuncfrom a JsonGenericLogger to remove many C filesDraft looking for review on 3 points:
1.Continuing discussion of #8922 (comment)
Should I really do that ?
Having a centralized store of hardcoded entries was the easy way for me to see which protocols are missing alert metadata