Skip to content
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

Log section for test on generated apps isn't very useful #863

Open
jwoertink opened this issue May 3, 2024 · 0 comments
Open

Log section for test on generated apps isn't very useful #863

jwoertink opened this issue May 3, 2024 · 0 comments
Labels
hacktoberfest Valid Issue for Hacktoberfest

Comments

@jwoertink
Copy link
Member

When you generate a new app, you get this section in your config/log.cr file

if LuckyEnv.test?
# Logs to `tmp/test.log` so you can see what's happening without having
# a bunch of log output in your spec results.
FileUtils.mkdir_p("tmp")
backend = Log::IOBackend.new(File.new("tmp/test.log", mode: "w"))
backend.formatter = Lucky::PrettyLogFormatter.proc
Log.dexter.configure(:debug, backend)
elsif LuckyEnv.production?

This used to be very helpful because back in the day when specs would run, you had a full HTTP server that booted, and you could tail this file to watch the logs and see what was going on. However, that's not the case anymore because booting an HTTP server on spec run is expensive and slow.

This leads to an issue where you run your specs, and you get a 500 error in an action, and tailing this log just looks like this

image

We need to figure out how we can rework this so your queries and errors and everything can go to this file and not STDOUT to the terminal. You should be able to tail this file while running specs and get good information as to what queries your spec is running and what exceptions or errors you're hitting.

@jwoertink jwoertink added the hacktoberfest Valid Issue for Hacktoberfest label Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest Valid Issue for Hacktoberfest
Projects
None yet
Development

No branches or pull requests

1 participant