Skip to content
This repository was archived by the owner on Mar 11, 2026. It is now read-only.
This repository was archived by the owner on Mar 11, 2026. It is now read-only.

Wrong types for Entry #442

@ofrobots

Description

@ofrobots

Consider the constructor for Entry.

class Entry {
  // ...
  constructor(metadata?: LogEntry, data?: Data) {
    this.metadata = extend(
        {
          timestamp: new Date(),
        },
        metadata);

It expects a LogEntry typed metadata value to be passed in. Historically this value has accepted a timestamp property with a JS Date value in it. You can see that internally it expects the timestamp to be a JavaScript Date as well. logging-bunyan passes in a JS Date as well.

The problem is that LogEntry type doesn't accept Date as a value for timestamp.

Metadata

Metadata

Assignees

Labels

🚨This issue needs some love.TypeScriptapi: loggingIssues related to the googleapis/nodejs-logging API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions