Closed davydovanton closed 6 years ago
I think it will be cool to just allow logger
getter in ability blocks. Something like:
class Post::Abilities
include Kan::Abilities
register 'read' do |user, _|
logger # => logger instance
logger.info 'Something happened'
true
end
end
And initialization:
admin_abilities = Kan::Application.new(
posts: Post::AdminAbilities.new(logger: MyLoggerClass.new),
comments: Comment::AdminAbilities.new, # => will use default STDOUT logger instance
)
@davydovanton could you please check https://github.com/davydovanton/kan/pull/7? Is this correct for you? I think there will be good to have some global Kan::Application::Logger that can be configured by configuration. What do you think about this?
@davydovanton do you have any ideas how logger should works and which kind of activity to log?