Skip to content

console.log({ a: string }) only prints 100 characters #22160

@e3dio

Description

@e3dio

Version: Deno 1.40.2

Logging an object only prints the first 100 characters of any strings in the object. This default needs to be higher. I see there is Deno.inspect but I'd rather not call console.log(Deno.inspect(value, { colors: true, strAbbreviateSize: 1000 })) every time I need to log to console. Node.js displays 10,000 characters. 1,000 would be better than 100.

console.log({ a: 'x'.repeat(150) });

{
  a: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"... 50 more characters
}
console.log(Deno.inspect({ a: 'x'.repeat(150) }, { colors: true, strAbbreviateSize: 1000 }));

{
  a: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    featnew feature (which has been agreed to/accepted)good first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions