tslog icon indicating copy to clipboard operation
tslog copied to clipboard

Bug: interface is missing optional hostname

Open Infern1 opened this issue 1 year ago • 2 comments

Describe the bug Compiler complains Property 'hostname' does not exist on type 'IMeta'. However it does exist, maybe not in all cases.

To Reproduce Try to access the logObj

Expected behavior Interface is extended with all parameters, something like:

export interface IMeta extends IMetaStatic {
  date: Date;
  logLevelId: number;
  logLevelName: string;
  hostname?: string;
  path?: IStackFrame;
}

Infern1 avatar Oct 04 '23 21:10 Infern1

How can I reproduce this?

terehov avatar Oct 05 '23 01:10 terehov

See this stackblitz:

https://stackblitz.com/edit/nodets-csuh1z?file=src%2Fmain.ts

src/main.ts:14:41 - error TS2339: Property 'hostname' does not exist on type 'IMeta'.

14   console.log(`hostname: ${output._meta.hostname}`)
                                           ~~~~~~~~


Found 1 error in src/main.ts:14

Infern1 avatar Oct 05 '23 07:10 Infern1