jennifer.cr icon indicating copy to clipboard operation
jennifer.cr copied to clipboard

Docs: fix logger level configuration

Open korun opened this issue 2 years ago • 1 comments

Hi!

What does this PR do?

Without fix it throws an error on fresh projects, like:

In config/initializers/database.cr:9:15

 9 | conf.logger.level = APP_ENV == "development" ? :debug : :error
                 ^----
Error: no overload matches 'Log#level=' with type Symbol

Overloads are:
 - Log#level=(value : Severity)

Any background context you want to provide?

jennifer:
  git: https://github.com/imdrasil/jennifer.cr.git
  version: 0.12.0
$ amber --version
Amber CLI (amberframework.org) - v1.2.2

$ crystal --version
Crystal 1.5.0 (2022-07-06)

LLVM: 14.0.6
Default target: x86_64-apple-macosx

$ shards --version
Shards 0.17.0 (2022-03-24)

Release notes

Actualize documentation for crystal version 1.5 to avoid "no overload matches" error

korun avatar Jul 10 '22 11:07 korun

This looks very strange. Could you share a code snippet that reproduces this issue (or at least a project). I tried it locally and everything looks ok

imdrasil avatar Aug 16 '22 21:08 imdrasil

$ crystal --version Crystal 1.6.2 [879691b2e] (2022-11-03)

jennifer version 0.12.0

require "jennifer"
puts typeof(Jennifer::Config.logger.level)
# prints `Log::Severity`

I can't find the exact crystal version when this was changed, but Log#level and Log#level= were changed to require the enum LogLevel::Severity.

nbfritch avatar Nov 19 '22 15:11 nbfritch