开发者

how to print varient value on rail3 controller

开发者 https://www.devze.com 2023-01-22 17:39 出处:网络
i want to print some variant value on console or logs then i can check is there 开发者_如何学Pythonsomething wrong,

i want to print some variant value on console or logs then i can check is there 开发者_如何学Pythonsomething wrong, i tried puts & print ,i didn't find output info,how to solve this,thanks,i'm new on rails


puts and print will output code in the console for code run in the console. A better method usually is to use the built in logging. For logging that you only want recorded in development, you can use the "logger.debug()" method. Just pass in a string as an argument and look for the results in log/development.log

logger.debug("Time.now is #{Time.now}")

Something like that.

0

精彩评论

暂无评论...
验证码 换一张
取 消