Skip to content

Commit

Permalink
Merge pull request #30 from tomtom-international/dev
Browse files Browse the repository at this point in the history
Minor improvements, updated dependecies
  • Loading branch information
RijnBuve-TomTom authored Sep 23, 2021
2 parents 236e400 + f36e941 commit c5a4f84
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 22 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,16 @@ Contributors: Timon Kanters, Jeroen Erik Jensen, Krzysztof Karczewski

## Release notes

### 1.4.1

* Updated POM dependencies.

* Replaced deprecated `Channel` methods `offer` and `poll` with current method variants `trySend` and `tryReceive`.

* Replaced some `internal` properties with `private` to be stricter on visibility.

* Removed redundant `suspend` modifiers from methods.

### 1.4.0

* Updated POM dependencies.
Expand Down
2 changes: 1 addition & 1 deletion memoization/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>com.tomtom.kotlin</groupId>
<artifactId>kotlin-tools</artifactId>
<version>1.4.0</version>
<version>1.4.1</version>
</parent>

<artifactId>memoization</artifactId>
Expand Down
14 changes: 7 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<groupId>com.tomtom.kotlin</groupId>
<artifactId>kotlin-tools</artifactId>
<version>1.4.0</version>
<version>1.4.1</version>
<packaging>pom</packaging>

<name>Kotlin Tools</name>
Expand Down Expand Up @@ -94,9 +94,9 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<!-- Plugin versions. -->
<dokka-maven-plugin.version>1.5.0</dokka-maven-plugin.version>
<dokka-maven-plugin.version>1.5.30</dokka-maven-plugin.version>
<maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
<maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
<maven-project-info-reports-plugin.version>3.1.2</maven-project-info-reports-plugin.version>
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
Expand All @@ -105,10 +105,10 @@
<!-- Library versions. -->
<equalsverifier.version>3.7.1</equalsverifier.version>
<junit.version>4.13.2</junit.version>
<junit-jupiter.version>5.8.0-RC1</junit-jupiter.version>
<kotlin.version>1.5.30</kotlin.version>
<kotlin-test.version>1.5.30</kotlin-test.version>
<kotlin-test-junit.version>1.5.30</kotlin-test-junit.version>
<junit-jupiter.version>5.8.0</junit-jupiter.version>
<kotlin.version>1.5.31</kotlin.version>
<kotlin-test.version>1.5.31</kotlin-test.version>
<kotlin-test-junit.version>1.5.31</kotlin-test-junit.version>
<kotlinx.html.version>0.7.3</kotlinx.html.version>
<kotlinx-coroutines-core.version>1.5.2-native-mt</kotlinx-coroutines-core.version>
<mockito-core.version>3.12.4</mockito-core.version>
Expand Down
2 changes: 1 addition & 1 deletion traceevents/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>com.tomtom.kotlin</groupId>
<artifactId>kotlin-tools</artifactId>
<version>1.4.0</version>
<version>1.4.1</version>
</parent>

<artifactId>traceevents</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class TraceEventConsumerCollection {
}
}

private suspend fun handleSpecificConsumer(
private fun handleSpecificConsumer(
traceEventConsumer: TraceEventConsumer,
traceEvent: TraceEvent
) {
Expand Down Expand Up @@ -179,7 +179,7 @@ class TraceEventConsumerCollection {
}
}

private suspend fun findFunctionByInspection(
private fun findFunctionByInspection(
traceEventsConsumerClass: KClass<*>,
traceEventListenerInterface: KClass<out TraceEventListener>,
traceEventFunction: String,
Expand Down Expand Up @@ -209,7 +209,7 @@ class TraceEventConsumerCollection {
return null
}

private suspend fun findAndCacheFunction(
private fun findAndCacheFunction(
traceEventConsumerClass: KClass<out TraceEventConsumer>,
traceEventListenerInterface: KClass<out TraceEventListener>,
traceEventFunction: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ interface TraceLog {
"[${LocalDateTime.now().format(DateTimeFormatter.ISO_DATE_TIME)}] $logLevel " +
"$tag: $message${e?.let { ", ${Tracer.formatThrowable(it, true)}" } ?: ""}"

internal var theLogger: Logger = DefaultLoggerToStdout
private var theLogger: Logger = DefaultLoggerToStdout
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class Tracer private constructor(
private val taggingClassName: String,
private val context: String
) : InvocationHandler {
val logTag = stripPackageFromClassName(tracerClassName)
private val logTag = stripPackageFromClassName(tracerClassName)

class Factory {
companion object {
Expand Down Expand Up @@ -376,7 +376,7 @@ class Tracer private constructor(
event: TraceEvent,
now: LocalDateTime?
) {
if (!traceEventChannel.offer(event)) {
if (!traceEventChannel.trySend(event).isSuccess) {
when (loggingMode) {
LoggingMode.SYNC ->

Expand Down Expand Up @@ -451,8 +451,8 @@ class Tracer private constructor(
}

companion object {
val TAG = Tracer::class.simpleName!!
const val STACK_TRACE_DEPTH = 5L
private val TAG = Tracer::class.simpleName!!
private const val STACK_TRACE_DEPTH = 5L

/**
* Names of simple, predefined log functions (from standard loggers).
Expand All @@ -478,7 +478,7 @@ class Tracer private constructor(
/**
* Default handler for asynchronous logging.
*/
internal val loggingTraceEventConsumer = LoggingTraceEventConsumer()
private val loggingTraceEventConsumer = LoggingTraceEventConsumer()

/**
* The co-routine scope of the event processor is internal, not private, to
Expand All @@ -491,14 +491,14 @@ class Tracer private constructor(
* This is the event processor job, running in co-routine scope
* [eventProcessorScope].
*/
internal lateinit var eventProcessorJob: Job
private lateinit var eventProcessorJob: Job

/**
* Capacity definition for the channel that queues traces.
*/
private const val CHANNEL_CAPACITY = 10000
internal val traceEventChannel = Channel<TraceEvent>(CHANNEL_CAPACITY)
internal val traceEventConsumers = TraceEventConsumerCollection()
private val traceEventConsumers = TraceEventConsumerCollection()

/**
* Parameters to indicate and deal with loss of traces.
Expand Down Expand Up @@ -590,7 +590,7 @@ class Tracer private constructor(
enabled = false

eventProcessorScope.launch(CoroutineName("flushTraceEvents")) {
while (traceEventChannel.poll() != null) {
while (traceEventChannel.tryReceive().getOrNull() != null) {
// Loop until queue is empty.
}
}.join()
Expand Down
2 changes: 1 addition & 1 deletion uid/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>com.tomtom.kotlin</groupId>
<artifactId>kotlin-tools</artifactId>
<version>1.4.0</version>
<version>1.4.1</version>
</parent>

<artifactId>uid</artifactId>
Expand Down

0 comments on commit c5a4f84

Please sign in to comment.