-
Notifications
You must be signed in to change notification settings - Fork 0
add logger #1
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
base: master
Are you sure you want to change the base?
add logger #1
Conversation
lib/simpler/middleware/logger.rb
Outdated
private | ||
|
||
def create_log | ||
[@status, @header, @body] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
какую функцию выполняет этот массив? если его удалить, по не сломается. А код станет не много чище
Parameters: #{@request.params} | ||
Response: #{full_status} \[#{@header["Content-Type"]}\] #{view} | ||
) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
так как лог файл может быть беконечно большим, то лог каждого запроса лучше писать в 1 строчку
log/app.log
Outdated
Handler: TestsController#question | ||
Parameters: {"one"=>"1", :id=>"487", :question_id=>"25"} | ||
Response: 200 OK [text/plain] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
лучше не класть лог файл в репозиторий
def index | ||
@time = Time.now | ||
render "tests/index" | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
согласно REST данный экшен должен отдавать список тестов, а не время
def create | ||
status 201 | ||
render plain: "Create method in action!" | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тут ведь ни чего не создаётся
No description provided.