Skip to content

Commit

Permalink
Merge pull request #35 from clay/omit-hostname
Browse files Browse the repository at this point in the history
fix: exclude hostname from clay-log json
  • Loading branch information
ealcantara22 authored Oct 24, 2024
2 parents 6995a39 + daebc0e commit 6b3da27
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,21 @@ function resolvePluginPath(dirname) {
* Initialize the logger.
*
* @param {Object} args
* @param {string} args.name
* @param {boolean} args.omitHost
* @param {object} args.meta
* @return {Function}
*/
function init(args) {
var output, stream, pretty, name, meta;
let output, stream, pretty, name, meta, omitHost;

checkArgs(args);

output = getOutput(args);
stream = getOutput(args);
pretty = getPrettyPrint(args);
name = args.name;
omitHost = args.omitHost || false;
meta = args.meta || undefined;

if (pretty) {
Expand All @@ -91,6 +95,7 @@ function init(args) {
// level is set via an env var called `LOG`
logger = pino({
name: name,
base: omitHost ? { pid: process.pid } : undefined,
level: process.env.LOG || 'info'
}, output);

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "clay-log",
"version": "1.5.4",
"version": "1.5.5",
"description": "An isomorphic logging module for Clay projects",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 6b3da27

Please sign in to comment.