4
我在這裏探索的源代碼:二郎「記錄」的解釋
https://github.com/s1n4/leptus/blob/master/include/leptus_logger.hrl
,並注意到這樣定義的記錄:
-record(log_data,
{
request_time = erlang:localtime() :: calendar:datetime(),
response_time :: undefined | calendar:datetime(),
request_line = "" :: string(),
ip :: inet:ip_address(),
version = 'HTTP/1.1' :: atom(),
method = <<"GET">> :: binary(),
uri = <<"/">> :: binary(),
headers = [] :: [{binary(), iodata()}],
status = 200 :: non_neg_integer(),
content_length = 0 :: non_neg_integer()
}).
我只知道用「雙冒號」的在列表解析和類型中。從來沒有發現任何有關記錄。搜索也沒有幫助。 我把它解釋爲:
'request_time' is 'erlang:local time()' of type 'calendar:date time()'
response_time is of type undefined or calendar:datetime
and so on ...
這是正確的嗎?
完美的感謝。 看了很多文件的那部分 – antipatreal 2014-10-01 19:43:14