pinojs/pino

Access to child object in logMethod

オープン

#897 opened on 2020/08/18

 (6 件のコメント) (1 件のリアクション) (0 人の担当者)JavaScript (839 件のフォーク)batch import
enhancementgood first issue

Repository metrics

Stars
 (13,157 個のスター)
PR merge metrics
 (平均マージ 1h 28m) (30d で 1 merged PR)

説明

I was looking to access the child object, I want to make so that it prepends the message object.

Here I log what inputArgs contains inside hooks.logMethod

after having called logger.child({"featureName":"MY FEATURE"}

{ inputArgs: [ 'special' ] }
{"level":30,"time":1597765635449,"featureName":"MY FEATURE","message":"special"}

I am trying to make a function that will prepend that name to message, so it becomes

{"level":30,"time":1597765635449,"featureName":"MY FEATURE","message":"MY FEATURE: special"}

コントリビューターガイド