Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/ews/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Connection
# @option opts [Array] :trust_ca an array of hashed dir paths or a file
# @option opts [String] :user_agent the http user agent to use in all requests
def initialize(endpoint, opts = {})
@log = Logging.logger[self.class.name.to_s.to_sym]
@log = Viewpoint::EWS.root_logger

httpclient_opts = opts.slice(*SUPPORTED_HTTPCLIENT_OPTS)
@httpcli = HTTPClient.new(**httpclient_opts)
Expand Down
2 changes: 1 addition & 1 deletion lib/ews/connection_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module EWS
# Helpers for building authenticated HTTP connections.
module ConnectionHelper
def init_logging!
@log = Logging.logger[self.class.name.to_s.to_sym]
@log = Viewpoint::EWS.root_logger
end

# @param [String] xml to parse the errors from.
Expand Down
2 changes: 1 addition & 1 deletion lib/ews/soap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module SOAP
MOVE_TO_DELETED_ITEMS = 'MoveToDeletedItems'

def initialize
@log = Logging.logger[self.class.name.to_s.to_sym]
@log = Viewpoint::EWS.root_logger
@default_ns = NAMESPACES["xmlns:#{NS_EWS_MESSAGES}"]
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/viewpoint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
require 'base64'
require 'nokogiri'
require 'ostruct'
require 'logging'
require 'logger' unless defined?(Logger)

# String utilities
require 'viewpoint/string_utils'
Expand Down
7 changes: 6 additions & 1 deletion lib/viewpoint/logging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.

require 'logger' unless defined?(Logger)

module Viewpoint
# Exchange Web Services (EWS) client namespace.
module EWS
attr_reader :logger

@root_logger = Logger.new($stdout)
@root_logger.level = Logger::WARN

def self.root_logger
Logging.logger.root
@root_logger
end
end
end
3 changes: 1 addition & 2 deletions lib/viewpoint/logging/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
module Viewpoint
# Exchange Web Services (EWS) client namespace.
module EWS
Logging.logger.root.level = :debug
Logging.logger.root.appenders = Logging.appenders.stdout
root_logger.level = Logger::DEBUG
end
end
3 changes: 2 additions & 1 deletion viewpoint.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ Gem::Specification.new do |s|
s.extra_rdoc_files = %w[README.md]

s.add_runtime_dependency 'httpclient'
s.add_runtime_dependency 'logging'
# logger is no longer a bundled gem on Ruby 4.0
s.add_runtime_dependency 'logger'
s.add_runtime_dependency 'mutex_m'
s.add_runtime_dependency 'nokogiri', '!=1.12.3', '!=1.12.2', '!=1.12.1', '!=1.12.0'
s.add_runtime_dependency 'rubyntlm'
Expand Down