Skip to content

logOptions handled incorrectly when sync: true is used #78

@randalpitt

Description

@randalpitt

Describe the bug
logOptions handled incorrectly when sync: true is used.

Expected behavior
logOptions are passed to the Logging.logSync function correctly.

Additional context

The log function accepts two arguments.

log(name: string, options?: LogOptions) {

Whereas the logSync function accepts three arguments, with options expected to be last.

logSync(name: string, transport?: Writable, options?: LogSyncOptions) {

In Cloud Pine, two arguments are passed to both the log and logSync functions. This results in no logs being sent to STDOUT when logSync is used because the options are overwriting the default transport.

this._log = this._sync
  ? this.logging.logSync(this.name, this._logOptions)
  : this.logging.log(this.name, this._logOptions)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions