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

Add logger support #5

Closed
davydovanton opened this issue Jan 14, 2018 · 3 comments
Closed

Add logger support #5

davydovanton opened this issue Jan 14, 2018 · 3 comments

Comments

@davydovanton
Copy link
Owner

No description provided.

@valikos
Copy link
Contributor

valikos commented Jan 15, 2018

@davydovanton do you have any ideas how logger should works and which kind of activity to log?

@davydovanton
Copy link
Owner Author

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
)

@valikos
Copy link
Contributor

valikos commented Jan 15, 2018

@davydovanton could you please check #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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants