padrino/padrino-framework — comment on commit f6708d845fbfbeadbff27f6e49b0e09d8717a736
File:  line 0
By marcosdsanchez:

Rake tasks are logged to a file by default in rails without changing any configuration.

You can try this yourself:

Create a datamapper project from scratch
rails new project_name -m http://datamapper.org/templates/rails.rb

Run db:automigrate and you'll see the database queries in /log/development.log

All rake tasks queries (even custom tasks) are logged to a file without running any -v command. (Which is what's expected by the user).

Here's the log after creating the database with a countries table and running a custom task that inserts a country in the table. All of this without modifying any configuration.

[datamapper] Setting up the "development" environment:
[datamapper] Setting up :default repository: '/home/marcos/Proyectos/M/db/M_development.db' on sqlite
[datamapper] Setting up the "development" environment:
[datamapper] Setting up :default repository: '/home/marcos/Proyectos/M/db/M_development.db' on sqlite
[1m[36mSQL (0.182ms)[0m [1mPRAGMA table_info("countries")[0m
[1m[35mSQL (0.018ms)[0m SELECT sqlite_version(*)
[1m[36mSQL (0.046ms)[0m [1mDROP TABLE IF EXISTS "countries"[0m
[1m[35mSQL (0.010ms)[0m PRAGMA table_info("countries")
[1m[36mSQL (234.934ms)[0m [1mCREATE TABLE "countries" ("id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "name" VARCHAR(50) NOT NULL)[0m
[1m[35mSQL (156.111ms)[0m CREATE UNIQUE INDEX "unique_countries_name" ON "countries" ("name")
[datamapper] Setting up the "development" environment:
[datamapper] Setting up :default repository: '/home/marcos/Proyectos/M/db/M_development.db' on sqlite
[1m[36mSQL (0.239ms)[0m [1mSELECT "id" FROM "countries" WHERE "name" = 'Argentina' ORDER BY "id" LIMIT 1[0m
[1m[35mSQL (245.342ms)[0m INSERT INTO "countries" ("name") VALUES ('Argentina')