title: How to make the pino library as generic and call everywhere in the project
body: <p>I'm very new to node.js and JS world. I'm doing logger into the existing node.js based testing application. I just picked 'pino' and using it as like below:</p>
  
  <pre><code>const pino = require('pino');
  const logger = pino({
      prettyPrint: true
    });
  
  logger.info("Flow---XXXX");
  </code></pre>
  
  <p>It returned below response when I run the <code>npm run test | pino-pretty -c -t</code></p>
  
  <p><strong>Output:</strong></p>
  
  <blockquote>
    <p>[1589538447177] INFO  (00020 on L-MAA-13i28828820): Flow---XXXX</p>
  </blockquote>
  
  <p>I have two questions here:</p>
  
  <ol>
  <li><p>I set -t flag in the command and I want it to convert the time stamp to user understanding format (like yyyy-mm-dd HH:mm:ss) but still it prints epoch format as look like above.</p></li>
  <li><p>I'm trying to add the below lines into all the JS files in the project. Is it possible to call it some JS file and export the logger object into other js files? It's like instead of calling the below lines everywhere in the project, can I create reusable js file and export the function?</p></li>
  </ol>
  
  <blockquote>
  <pre><code>  const pino = require('pino');
      const logger = pino({
          prettyPrint: true
        });
  </code></pre>
  </blockquote>
  
  <p>I'm not sure whether the 2 request is possible to achieve but It would be great if I get some leads..</p>
  
  <p>Thanks in advance.</p>
  
  <p>Updates:</p>
  
  <p>I resolved the first question by using module.export option as like below:</p>
  
  <pre><code> module.export.log = function(input)
      {
  
      logger.info(input);
      }
  </code></pre>
  
  <p>Can someone help me to display the user readable format time in the log? Right now It prints epoch.. I tried below code but still no luck.</p>
  
  <pre><code>const logger = pino({
      prettyPrint: true,
      timestamp:`,"time":"${new Date(Date.now())}"`
    });
  </code></pre>
  
  <p>I can see there is const variable in the pino library called timestamp and default value is assigned as epoch time.</p>
  
  <p>I will post if I find any solution</p>