如果这个问题已经得到回答,我提前道歉。我一直在尝试在 Google 和 StackOverflow 上搜索此内容,但由于我的搜索查询中有标点符号,搜索引擎往往会对其进行处理并给我无意义的结果。
在我的 rails 应用程序(rails 3.2.11,ruby 1.9.3)中,我的日志通常如下所示:
Started GET "/apply/contact" for 127.0.0.1 at 2013-01-29 17:35:21 -0600
Processing by JobApplicationsController#show as HTML
Parameters: {"id"=>"contact"}
[1m[36mJobApplication Load (0.5ms)[0m [1mSELECT "job_applications".* FROM "job_applications" WHERE "job_applications"."id" = 9 LIMIT 1[0m
[1m[35mPerson Load (0.4ms)[0m SELECT "people".* FROM "people" WHERE "people"."id" = 42 LIMIT 1
Rendered job_applications/contact.html.haml within layouts/bare (9.6ms)
Rendered shared/_messages.html.haml (0.1ms)
Completed 200 OK in 88ms (Views: 24.8ms | ActiveRecord: 0.9ms | Solr: 0.0ms)
我想知道的是关于[1m[36m
and[1m[35m
标记,它们出现在某些行之前,以及[0m
有时[1m
出现在行内的 and 。
唯一出现的数字是 0、1、32、35 和 36。这些标记在日志文件中总是以不可打印的转义字符开头。
这些数字代表什么?为什么它们会出现在我的日志中?有没有办法摆脱它们?他们(和他们的转义角色朋友)在尝试阅读日志并诊断问题时非常烦人。