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
Hi @rade-tomovic. Setting :logger to nil (as you have done in the Client options) should normally disable logging. Looking at the error, it seems like an issue with the Sorbet type signature for Config#logger, which is confusing because it should be nilable (see this line), so I'm not too sure what's happening here.
I'll need to investigate further. Will get back to you once I know more.
The only way to go around it is to monkey patch config with ugly overrides, but definitely not something I would like to use as solution for production - I would still like to use SemanticLogger as is.
# config/initalizers# frozen_string_literal: truemoduleVonageclassSemanticLoggerAdapter < ::Loggerdefinitialize(semantic_logger)@semantic_logger=semantic_loggersuper($stdout)# Parent needs an IO object but we won't use itend
::Logger::Severity.constants.eachdo |severity|
define_method(severity.downcase)do |*args, &block|
message=block_given? ? block.call : args.first@semantic_logger.send(severity.downcase,message)endendendclassConfigdeflogger=(logger)@logger=Logger.new(SemanticLoggerAdapter.new(logger))endendend
@rade-tomovic sorry, I've not had a chance to look at this in depth yet. TBH I'm not familiar with SemanticLogger. I'll try and carve out some time over the next week or two to dig into it.
I want to be able to use any logger. Currently, SemanticLogger is not working for no obvious reason.
Config:
The text was updated successfully, but these errors were encountered: