Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document that logger now encodes table arguments in JSON #4721

Open
TarantoolBot opened this issue Dec 25, 2024 · 0 comments
Open

Document that logger now encodes table arguments in JSON #4721

TarantoolBot opened this issue Dec 25, 2024 · 0 comments

Comments

@TarantoolBot
Copy link
Collaborator

How it used to work:

tarantool> require('log').info('%s', {foo = 'bar'})
table: 0x41f9d2e8

How it works now:

tarantool> require('log').info('%s', {foo = 'bar'})
{"foo":"bar"}

Note, JSON encoding is enabled only for tables that don't have
the __tostring meta-method:

tarantool> require('log').info('%s', setmetatable({foo = 'bar'}, {__tostring = function() return 'foobar' end}))
foobar

Requested by @locker in tarantool/tarantool@3db73c6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant