You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Setting Embedly logger to Rails.logger in Rails v4 seems to stop Rails logging from working #22
The problem is that Embedly changes the log_level of the provided logger. In fact, it shouldn't touch the externally provided logger, but only set the log level if the logger was created by embedly itself. The workaround for time being is the following monkey patch:
Frankly, I don't like the way it's currently designed. So I don't see a good way to fix it properly without breaking the current api. I would say that Embedly shouldn't do the log level setting at all. It should receive a Logger or instantiate one, expose the logger instance, and then the user can change the log level at will. For the most cases, I assume that the users are re-using some logger (probably Rails logger), so they would prefer to set the log level globally and that's it.
And if you really want fine grain control over debugging things, then maybe it's better to have a debug method which would do something like:
I think the only reason that setting the level is in there is for the CLI to support --verbose. Over time it somehow got lumped into "configuration". That should probably be moved to the CLI related code.
Activity
romanbsd commentedon Mar 13, 2014
👍
The problem is that Embedly changes the log_level of the provided logger. In fact, it shouldn't touch the externally provided logger, but only set the log level if the logger was created by embedly itself. The workaround for time being is the following monkey patch:
dokipen commentedon Mar 13, 2014
Thanks. Any chance I can get a pull request to fix this for real?
romanbsd commentedon Mar 13, 2014
Frankly, I don't like the way it's currently designed. So I don't see a good way to fix it properly without breaking the current api. I would say that Embedly shouldn't do the log level setting at all. It should receive a Logger or instantiate one, expose the logger instance, and then the user can change the log level at will. For the most cases, I assume that the users are re-using some logger (probably Rails logger), so they would prefer to set the log level globally and that's it.
And if you really want fine grain control over debugging things, then maybe it's better to have a debug method which would do something like:
dokipen commentedon Mar 13, 2014
I think the only reason that setting the level is in there is for the CLI to support --verbose. Over time it somehow got lumped into "configuration". That should probably be moved to the CLI related code.