2010-11-25 88 views
2

我得到這在我的發展日誌。 mCACHE線意味着什麼?他們是SQL查詢嗎?Rails日誌。這是什麼意思

←[1m←[36mTodo Load (1.0ms)←[0m ←[1mSELECT "todos".* FROM "todos" WHERE ("todos".project_id IN (4,5,6,7,8,9,10,11,12,13))←[0m 
←[1m←[35mLog Load (1.0ms)←[0m SELECT "logs".* FROM "logs" WHERE ("logs".todo_id IN (134,135,136)) 
←[1m←[36mCACHE (0.0ms)←[0m ←[1mSELECT "firms".* FROM "firms" WHERE ("firms"."id" = 2) LIMIT 1←[0m 
←[1m←[35mCACHE (0.0ms)←[0m SELECT "users".* FROM "users" WHERE ("users"."id" = 3) LIMIT 1 
←[1m←[36mCACHE (0.0ms)←[0m ←[1mSELECT "users".* FROM "users" WHERE ("users"."id" = 3) LIMIT 1←[0m 
←[1m←[35mCACHE (0.0ms)←[0m SELECT "users".* FROM "users" WHERE ("users"."id" = 3) LIMIT 1 
←[1m←[36mCACHE (0.0ms)←[0m ←[1mSELECT "firms".* FROM "firms" WHERE ("firms"."id" = 2) LIMIT 1←[0m 
←[1m←[35mCACHE (0.0ms)←[0m SELECT "firms".* FROM "firms" WHERE ("firms"."id" = 2) LIMIT 1 
←[1m←[36mCACHE (0.0ms)←[0m ←[1mSELECT "firms".* FROM "firms" WHERE ("firms"."id" = 2) LIMIT 1←[0m 
←[1m←[35mCACHE (0.0ms)←[0m SELECT "firms".* FROM "firms" WHERE ("firms"."id" = 2) LIMIT 1 
←[1m←[36mCACHE (0.0ms)←[0m ←[1mSELECT "firms".* FROM "firms" WHERE ("firms"."id" = 2) LIMIT 1←[0m 
←[1m←[35mCACHE (0.0ms)←[0m SELECT "firms".* FROM "firms" WHERE ("firms"."id" = 2) LIMIT 1 
←[1m←[36mCACHE (0.0ms)←[0m ←[1mSELECT "firms".* FROM "firms" WHERE ("firms"."id" = 2) LIMIT 1←[0m 
←[1m←[35mCACHE (0.0ms)←[0m SELECT "firms".* FROM "firms" WHERE ("firms"."id" = 2) LIMIT 1 
←[1m←[36mCACHE (0.0ms)←[0m ←[1mSELECT "firms".* FROM "firms" WHERE ("firms"."id" = 2) LIMIT 1←[0m 
+3

如果您正在使用查看日誌的方式,可以使用「-r」開關。 「less -r development.log」,這將正確解釋ANSI代碼並使事物看起來不錯。 – Roadmaster 2010-11-25 19:53:37

+0

@Roadmaster:很高興知道,謝謝! – Piskvor 2010-11-25 20:03:27

+0

對於日誌的輸出預計爲`cat``或`tail -f`'d到終端可以解釋代碼的屏幕。如果你使用編輯器,或者`less`沒有`-r`,你會得到uuuuu-gly輸出。 – 2010-11-25 20:46:23

回答

2

緩存意味着你已經運行相同的查詢,它的結果存儲在內存中,因此查詢不實際上針對數據庫運行。它們都是查詢,這是Active Record在與數據庫進行交談時實際執行的操作。

4

[numberm只是ANSI color codes - 它應該表現出一個智能終端漂亮的顏色,否則很糟糕。

CACHE是「一個sql查詢,緩存(先前執行,現在從緩存中加載)」 - 請參閱this

+0

謝謝!你知道任何智能終端的Windows? – 2010-11-25 19:57:37