-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Allowing use of both meta and splat in same call to log() #1485
Conversation
The arguments.length > 2 section in log() examines the first item in the splat param to see if it's a meta object. Problem was, a subsequent call to splat.slice() still included that meta object in the splat.
Here you go @DABH – I just went and created a new PR, as you can see. Thanks for checking this out! |
Thanks for the example, that helps clarify things! :) I took a look and this really seems like a silly bug (why would you call splat.slice(0) and not just splat? clearly the intent was to remove meta from splat, hence should be splat.slice(1)). Going to merge this, and it should land in the next release in about a week! Thanks again for your patience and contribution! |
Great, thanks again for doing so much for this project! 😊🙌 |
Actually this seems problematic -- I can no longer log a single object as a splat: |
@mpabst how would you feel about putting your extra meta objects after your other splats? I feel like that is more logical and the way it may have been intended to work... would love your feedback on |
Hey! Sorry for the late reply, but that should be totally fine. It’s just a reordering of those parameters to log(), right? Thanks again!
… On Oct 9, 2018, at 15:43, DABH ***@***.***> wrote:
@mpabst <https://github.com/mpabst> how would you feel about putting your extra meta objects after your other splats? I feel like that is more logical and the way it may have been intended to work... would love your feedback on
#1499 <#1499>
winstonjs/logform#57 <winstonjs/logform#57>
! Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#1485 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAL12J0MoQC0k9Pssd_0SBKmgs2TFuFrks5ujQp-gaJpZM4XAPgL>.
|
The arguments.length > 2 section in log() examines the first item in the splat param to see if it's a meta object. Problem was, a subsequent call to splat.slice() still included that meta object in the splat.
…on & logform (winstonjs#1552) * [doc fix] Build on the work from winstonjs#1485 fixes. * [tiny] Formatting changes. * [fix test] Updated tests to latest (consistent) semantics. * [dist] Update to `logform@2.0.0` and `winston-transport@4.3.0`. * [doc] Document all possible permuations for splat.
The
arguments.length
> 2 section inlog()
examines the first item in thesplat
param to see if it's ameta
object. Problem is, a subsequent call tosplat.slice()
still includes thatmeta
object in thesplat
, accidentally callingslice(0)
instead ofslice(1)
.Here's an example that breaks under the merge target but works when using the merge source: