-
Notifications
You must be signed in to change notification settings - Fork 13
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
[WIP] Log marker #24
[WIP] Log marker #24
Conversation
Codecov Report
@@ Coverage Diff @@
## master #24 +/- ##
==========================================
- Coverage 100% 98.37% -1.63%
==========================================
Files 3 4 +1
Lines 106 123 +17
==========================================
+ Hits 106 121 +15
- Misses 0 1 +1
- Partials 0 1 +1
Continue to review full report at Codecov.
|
Do we need to create a variadic |
I think it should be another PR. See issue #27. |
What should be another PR? |
Re: Variadic method For the first pass I feel like the slice approach is good enough but if it's not a huge ordeal we might as well put it in this PR. What do you think the LoE is? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking so good 👍 few questions/suggestions!
Oh, we need to test the rule apply order by the way. Since we are applying the rules sequentially, some matches can overlap - later order matcher will override the previous ones if there is an overlap. Users need to be aware of it and add their mark rules according to the order too. We need to document this and give an example for it too. |
I don't know what |
Implemented some helper functionality for our assertions in |
You can not compare function. See https://stackoverflow.com/questions/42140758/collection-of-unique-functions-in-go/42147285#42147285 |
This approach actually looks like working. I tested it for our |
This behaviour is implementation defined. |
You mean undefined? |
No. Current standard says that functions are incomparable, see https://golang.org/ref/spec#Comparison_operators . |
I get it. This behavior is not specified and so, can vary between different compiler implementations.
I prefer the second way if the tests for the first option will impact the implementation and make it more complex. |
I think second option is fine, but you should come up with test that cover order of rules too. |
Aye aye, captain! |
|
||
expectedLog = fmt.Sprintf("best %s %s is %s\n", red("data"), red("company"), red(blue("skydome"))) | ||
logger.Print("best data company is skydome") | ||
assert.Equal(t, expectedLog, mockOut.actualLog) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, this is so cool
@cyucelen is it just the readme docs that remain for this feature? super excited to integrate it into some projects |
@jnatalzia yes, can you help about docs? |
Can do! |
log.go
Outdated
} | ||
|
||
// NewWriteMarker creates a Marker that writes out to the given io.Writer | ||
func NewWriteMarker(writer io.Writer, options ...StdoutMarkerOption) *StdoutMarker { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @cyucelen in writing the docs, I refactored the way that we deal with custom out
s. instead of having to replace stdout on the created marker, i flipped it so both cases (stdout and custom) require a single function call and no more than that.
let me know what you think, happy to discuss changing it back but it felt more natural when making the example file for this writer type so i thought it might be a good change
Docs added! Also refactored a small portion of the code, added a comment explaining what and why to the PR |
We merged the @Darkclainer s unified image PR to master. Can you integrate it to this branch? I will review your last commit about Writer asap! |
Yes I can! Also seems like I need to add some code coverage, gotta love CI. Will fix it up today at some point |
Codecov Report
@@ Coverage Diff @@
## master #24 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 3 4 +1
Lines 106 121 +15
=====================================
+ Hits 106 121 +15
Continue to review full report at Codecov.
|
Hmmm @Darkclainer can we make an issue/PR to update the docs for using the image generator? It requires a pip install (maybe foreign for a go repo) as well as two separate terminal dependencies but no indication of where to get them. I can guess but given I'm installing them in the shell, I'd prefer to have sanctioned sources cc @cyucelen |
Awesome PR @jnatalzia! I just added some docs for image_generator, also updated the images of log feature in readme. Maybe we can get rid of functional options in Looks like we are getting ready for the deployment! 😎 Also, what do you think about #29 ? @jnatalzia @Darkclainer |
Sounds like a plan! Will push an update with those removed and then I think we're good to merge. Will mark as no longer draft. Will comment on #29 on the issue! |
Looks like we are good to go! Do the final touch, merge it! |
It stands to reason that one of the strongest use cases would be for users to colorize their logs for easy reading.
We can add further features to the checklist!
Closes #17