-
Notifications
You must be signed in to change notification settings - Fork 57
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
debug string function should be implemented as in C++ and Python #12
Comments
Do you need this only for logging? Then till this is available here, you may want to look at what is provided by the JSON package (https://github.com/JuliaLang/JSON.jl). |
Well, using JSON is not really an option, because I have already 15 programs that communicate with protobuf encoded messages over ZeroMQ sockets. In addition I have already 14 GB of log files that use the debug string notation from protobuf (see: https://bitbucket.org/ufechner/juliaexperiments/src/bd4d49a5fc83ccfb52c92b0fef17971964ca4701/log/2012-06-14_13-49-55_ProtoLogger.txt?at=master ) Currently I analyse the log files with a mix of C++ and Python. Python alone is too slow, but maintaining the C++ code is cumbersome, I would like to do this task with Julia. But I cannot do that before the protobuf.text_format interface is implemented. |
The primary hurdle in implementing this is the absence of any specifications. It needs digging through the C++ implementation to figure out the protocol. I will be able to take this up only after 2-3 weeks. Any help in implementing this is welcome! |
Is there already a function to convert an enum value into the corresponding string? |
No, it's not there now. But it is possible to have some generic method to do this for all enums. Can you provide some examples/use cases? |
The recently added |
Is there any update on if this will be implemented soon? |
There seem to be multiple issues about text-format, closing this one in favor of #66. As a workaround, you can use |
The C++ and Python API define a human readable serialization of protobuf messages which is very useful for logging and debugging.
Example:
est_system_state { header { time_rel: 0.0 } pos_east: 1 pos_north: 2 height: 3 velocity_w { vx: 8 vy: 0.1 vz: 0 } }
The C++ API is described here:
https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.text_format?csw=1#TextFormat
The current string representation is hard to read and to understand:
EstimatedSystemState(StateHeader(0.0,0,false,559105,0.0,0.0),#undef,#undef,1.0f0,2.0f0,3.0f0,0.5f0,0.4f0,0.0f0,150.0f0,20.0f0,22.0f0,0.0f0,0.2f0,0.0f0,8.1783904f-38,20.0f0,Velocity_W(8.0f0,0.1f0,0.0f0),#undef,Heading_D(3.0f0,4.0f0),Course_D(4.0f0,5.0f0),false,#undef,#undef,#undef,8.3320624f-36)
The field names are missing, undefined fields appear, spaces are missing and the names of the messages are in camel case, which is not the case in the C++ or Python string representation (there camel case is automatically converted to words in small letters, using underscores between the letters).
The text was updated successfully, but these errors were encountered: