@@ -9,7 +9,11 @@ import com.squareup.workflow1.WorkflowInterceptor.WorkflowSession
99import kotlin.reflect.KClass
1010import kotlin.reflect.KType
1111
12- internal fun WorkflowSession.toWfLoggingName (): String {
12+ /* *
13+ * Short name that can be used for logs that has the [identifier] logged as well
14+ * as the key.
15+ */
16+ public fun WorkflowSession.toWfLoggingName (): String {
1317 val renderKey = renderKey
1418 return if (renderKey.isEmpty()) {
1519 identifier.toWfLoggingName()
@@ -18,7 +22,11 @@ internal fun WorkflowSession.toWfLoggingName(): String {
1822 }
1923}
2024
21- internal fun WorkflowIdentifier.toWfLoggingName (): String {
25+ /* *
26+ * Short name that for the identifier that can be used for logs. This reports
27+ * the 'log name' of the class.
28+ */
29+ public fun WorkflowIdentifier.toWfLoggingName (): String {
2230 return when (val type = realType) {
2331 is Snapshottable -> type.kClass?.toWfLoggingName() ? : type.typeName
2432 is Unsnapshottable -> type.kType.toWfLoggingName()
@@ -55,7 +63,10 @@ public fun String.workerKey(): String {
5563 }
5664}
5765
58- internal fun KType.toWfLoggingName (): String {
66+ /* *
67+ * Reasonable log name based on type.
68+ */
69+ public fun KType.toWfLoggingName (): String {
5970 if (classifier == null ) return toString().wfStripSquarePackage()
6071
6172 val classifierName = when (val c = classifier) {
@@ -79,7 +90,7 @@ internal fun KType.toWfLoggingName(): String {
7990 *
8091 * For example, `java.util.Map` would be `Map`, and `java.util.Map.Entry` would be `Map.Entry`.
8192 */
82- internal fun getWfHumanClassName (obj : Any ): String {
93+ public fun getWfHumanClassName (obj : Any ): String {
8394 val objClass: Class <* > = when (obj) {
8495 is KClass <* > -> obj.java
8596 is Class <* > -> obj
@@ -98,7 +109,10 @@ internal fun getWfHumanClassName(obj: Any): String {
98109 return humanName
99110}
100111
101- internal fun KClass <* >.toWfLoggingName (): String {
112+ /* *
113+ * Reasonable class name based on type.
114+ */
115+ public fun KClass <* >.toWfLoggingName (): String {
102116 return getWfHumanClassName(this )
103117}
104118
@@ -134,7 +148,7 @@ public fun getWfLogString(log: Any?): String {
134148 * @param maxLength The maximum length the string can be before ellipsizing will occur. This must be
135149 * a positive number.
136150 */
137- internal fun String.wfEllipsizeEnd (maxLength : Int ): String {
151+ public fun String.wfEllipsizeEnd (maxLength : Int ): String {
138152 require(maxLength > 0 )
139153
140154 return if (maxLength < length) {
@@ -147,7 +161,7 @@ internal fun String.wfEllipsizeEnd(maxLength: Int): String {
147161/* *
148162 * Removes the string from kotlin.jvm.internal.Reflection#REFLECTION_NOT_AVAILABLE
149163 */
150- internal fun String.wfRemoveReflectionNotAvailable () = replace(
164+ public fun String.wfRemoveReflectionNotAvailable () = replace(
151165 " (Kotlin reflection is not available)" ,
152166 " "
153167)
@@ -158,7 +172,7 @@ internal fun String.wfRemoveReflectionNotAvailable() = replace(
158172 *
159173 * This will help make things more readable for classes within this library.
160174 */
161- internal fun String.wfStripSquarePackage (): String {
175+ public fun String.wfStripSquarePackage (): String {
162176 // Find the index of every "com.squareup".
163177 var cursor = 0
164178 var packages: MutableList <Int >? = null
0 commit comments