diff --git a/lib/bunyan.js b/lib/bunyan.js index 405cdb24..ebe7e0f7 100644 --- a/lib/bunyan.js +++ b/lib/bunyan.js @@ -518,7 +518,7 @@ function Logger(options, _childOptions, _childSimple) { if (!fields.hostname && !self.fields.hostname) { fields.hostname = os.hostname(); } - if (!fields.pid) { + if (!fields.pid && runtimeEnv !== 'browser') { fields.pid = process.pid; } Object.keys(fields).forEach(function (k) { @@ -950,7 +950,8 @@ function mkRecord(log, minLevel, args) { // `log.(msg, ...)` fields = null; msgArgs = args.slice(); - } else if (Buffer.isBuffer(args[0])) { // `log.(buf, ...)` + } else if (typeof (Buffer) !== 'undefined' && Buffer.isBuffer(args[0])) { + // `log.(buf, ...)` // Almost certainly an error, show `inspect(buf)`. See bunyan // issue #35. fields = null;