Comments (6)
Might be interesting.
from zerolog.
@rs - just keeping you posted.. am more than half-way done with binary support - you could see the changes here: https://github.com/toravir/zerolog/commits/binary
I could use review comments...
from zerolog.
I have a few questions:
- Why CBOR instead of BSON? (This is a candid question, I don't know much about CBOR)
- How do you plan to plug the
cbor
package intoevent
/context
? - Why did you refactor the
json
package? I'm not against it but I don't think it belongs to this PR (and it will make the review harder). - Is
cbor
package custom made for this PR or copied/adapted from another project? If the later, we need to put copyright info. - The global binary flag can be confusing. It gives the impression that it will turn all logging into binary, even existing instances. What it really does is changing the default encoding. Its name (and doc) should reflect that.
I did not review the cbor
package implementation yet. I need some time to read the spec etc. I will save that for when you are ready for the PR.
Good job!
from zerolog.
Why CBOR instead of BSON? (This is a candid question, I don't know much about CBOR)
CBOR is more flexible with multiple different data types that BSON - bson is specific to how mongodb sends json objects across the wire. Plus CBOR is a RFC Standard. I had posted on JSON forum ([email protected]) and got a recommendation to use CBOR. FYI - CBOR RFC: https://tools.ietf.org/html/rfc7049
How do you plan to plug the cbor package into event/context?
It is not as clean plug as i would have liked - but i have pushed one approach. Am open to other ways of doing this. The first cut is in this commit: toravir@a6948d4#diff-9fb85d1ee9f1b0a59804bec41e1491fe
Why did you refactor the json package? I'm not against it but I don't think it belongs to this PR (and it will make the review harder).
Sure i can push that change as a different PR. The idea is to isolate all JSON specific writes to json package - so that common code does not have any JSON specific writes - only few minor changes.
Is cbor package custom made for this PR or copied/adapted from another project? If the later, we need to put copyright info.
I wrote this code from ground up. Other implementations i had seen were JSON to CBOR - could not be re-used for zerolog's purpose.
The global binary flag can be confusing. It gives the impression that it will turn all logging into binary, even existing instances. What it really does is changing the default encoding. Its name (and doc) should reflect that.
Sure will rename it to imply the correct meaning.
Thx
from zerolog.
@toravir any news on that PR?
from zerolog.
@rs - will submit PR shortly. Has two items in the todo - will commit within a week or two:
- Changes to documentation (README.md)
- When doing reflection, skip using JSON and write a binary based encoder
from zerolog.
Related Issues (20)
- Understanding "Zero Allocation" HOT 1
- Is there a recommended way to do batching of log lines and write at once ? HOT 1
- Logs as bytes in Stderr HOT 6
- Deep Example
- Latest official tagged release not up to date in github? HOT 1
- Add an option to limit max log's size after escaping
- Give debug level logs a color again
- ConsoleWriter uses the `level` field key to be invalid or panic? HOT 1
- diode writer does not flush when program exits HOT 1
- Should journald keys be sanitized to strip/replace invalid characters? HOT 2
- Differentiating Error Level Log Output in Terminal and Hook HOT 1
- getting name of the function where a log being called HOT 5
- Use TimestampFunc for sampling HOT 1
- Yu
- level, message are built-in keywords? Field keywords level or message are invalid HOT 1
- Hook after writing
- Support for msgpack encoder
- The README does not document the default log level of the library
- how to get Event timestamp in hook Run() ?
- Question: Using Dict Inside an Array would not put back the byte buffer back into pool, is this the expectation?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zerolog.