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 Producer.withLogging1/Consumer.withLogging1 for binary compatibility #374

Merged
merged 1 commit into from
Aug 24, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -1345,6 +1345,16 @@ object Consumer {
ConsumerLogging(log, self)
}

/** The sole purpose of this method is to support binary compatibility with an intermediate
* version (namely, 15.2.0) which had `withLogging` method using `MeasureDuration` from `smetrics`
* and `withLogging1` using `MeasureDuration` from `cats-helper`.
* This should not be used and should be removed in a reasonable amount of time.
*/
@deprecated("Use `withLogging`", since = "16.0.2")
def withLogging1(log: Log[F])(implicit F: Monad[F], measureDuration: MeasureDuration[F]): Consumer[F, K, V] = {
withLogging(log)
}

def mapK[G[_]](fg: F ~> G, gf: G ~> F)(implicit F: Monad[F]): Consumer[G, K, V] = new MapK with Consumer[G, K, V] {

def assign(partitions: Nes[TopicPartition]) = fg(self.assign(partitions))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,16 @@ object Producer {
ProducerLogging(self, log)
}

/** The sole purpose of this method is to support binary compatibility with an intermediate
* version (namely, 15.2.0) which had `withLogging` method using `MeasureDuration` from `smetrics`
* and `withLogging1` using `MeasureDuration` from `cats-helper`.
* This should not be used and should be removed in a reasonable amount of time.
*/
@deprecated("Use `withLogging`", since = "16.0.2")
def withLogging1(log: Log[F])(implicit F: MonadThrow[F], measureDuration: MeasureDuration[F]): Producer[F] = {
withLogging(log)
}

/**
* @param charsToTrim a number of chars from record's value to log when producing fails because of a too large record
*/
Expand All @@ -344,6 +354,22 @@ object Producer {
ProducerLogging(self, log, charsToTrim)
}

/**
* The sole purpose of this method is to support binary compatibility with an intermediate
* version (namely, 15.2.0) which had `withLogging` method using `MeasureDuration` from `smetrics`
* and `withLogging1` using `MeasureDuration` from `cats-helper`.
* This should not be used and should be removed in a reasonable amount of time.
*
* @param charsToTrim a number of chars from record's value to log when producing fails because of a too large record
*/
@deprecated("Use `withLogging`", since = "16.0.2")
def withLogging1(
log: Log[F],
charsToTrim: Int
)(implicit F: MonadThrow[F], measureDuration: MeasureDuration[F]): Producer[F] = {
withLogging(log, charsToTrim)
}

def withMetrics[E](
metrics: ProducerMetrics[F]
)(implicit F: MonadError[F, E], measureDuration: MeasureDuration[F]): Producer[F] = {
Expand Down
Loading