diff --git a/src/index.ts b/src/index.ts index d8db81e..659a511 100644 --- a/src/index.ts +++ b/src/index.ts @@ -17,7 +17,7 @@ export class Logger extends BaseLogger { // style only for blink browsers settings.stylePrettyLogs = settings.stylePrettyLogs && isBrowser && !isBrowserBlinkEngine ? false : settings.stylePrettyLogs; - super(NodeRuntime, settings, logObj, isSafari ? 4 : 5); + super(isBrowser && typeof(process) === 'undefined' ? BrowserRuntime : NodeRuntime, settings, logObj, isSafari ? 4 : 5); } /** diff --git a/src/runtime/nodejs/index.ts b/src/runtime/nodejs/index.ts index bbbac84..fb23053 100644 --- a/src/runtime/nodejs/index.ts +++ b/src/runtime/nodejs/index.ts @@ -34,8 +34,8 @@ export interface IMeta extends IMetaStatic { const meta: IMetaStatic = { runtime: "Nodejs", - runtimeVersion: process.version, - hostname: hostname(), + runtimeVersion: (typeof process !== 'undefined') ? process.version : null, + hostname: hostname ? hostname() : null, }; export function getMeta(