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

Bring back Odin module #391

Merged
merged 8 commits into from
Oct 2, 2022
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ jobs:

- name: Make target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/series/0.1')
run: mkdir -p modules/mtl/native/target modules/lightstep-grpc/target modules/log/jvm/target modules/noop/jvm/target modules/mock/target modules/examples/target target modules/log/native/target .js/target modules/core/native/target modules/docs/target modules/lightstep-http/target modules/datadog/target modules/xray/jvm/target modules/opentracing/target modules/noop/native/target modules/xray/js/target modules/core/js/target modules/noop/js/target modules/core/jvm/target .jvm/target modules/jaeger/target .native/target modules/opencensus/target modules/honeycomb/target modules/log/js/target modules/mtl/js/target modules/newrelic/target modules/mtl/jvm/target modules/lightstep/target project/target
run: mkdir -p modules/mtl/native/target modules/lightstep-grpc/target modules/log/jvm/target modules/noop/jvm/target modules/mock/target modules/examples/target target modules/log/native/target .js/target modules/core/native/target modules/docs/target modules/lightstep-http/target modules/datadog/target modules/xray/jvm/target modules/opentracing/target modules/noop/native/target modules/xray/js/target modules/core/js/target modules/noop/js/target modules/core/jvm/target .jvm/target modules/jaeger/target .native/target modules/opencensus/target modules/honeycomb/target modules/log/js/target modules/mtl/js/target modules/newrelic/target modules/log-odin/target modules/mtl/jvm/target modules/lightstep/target project/target

- name: Compress target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/series/0.1')
run: tar cf targets.tar modules/mtl/native/target modules/lightstep-grpc/target modules/log/jvm/target modules/noop/jvm/target modules/mock/target modules/examples/target target modules/log/native/target .js/target modules/core/native/target modules/docs/target modules/lightstep-http/target modules/datadog/target modules/xray/jvm/target modules/opentracing/target modules/noop/native/target modules/xray/js/target modules/core/js/target modules/noop/js/target modules/core/jvm/target .jvm/target modules/jaeger/target .native/target modules/opencensus/target modules/honeycomb/target modules/log/js/target modules/mtl/js/target modules/newrelic/target modules/mtl/jvm/target modules/lightstep/target project/target
run: tar cf targets.tar modules/mtl/native/target modules/lightstep-grpc/target modules/log/jvm/target modules/noop/jvm/target modules/mock/target modules/examples/target target modules/log/native/target .js/target modules/core/native/target modules/docs/target modules/lightstep-http/target modules/datadog/target modules/xray/jvm/target modules/opentracing/target modules/noop/native/target modules/xray/js/target modules/core/js/target modules/noop/js/target modules/core/jvm/target .jvm/target modules/jaeger/target .native/target modules/opencensus/target modules/honeycomb/target modules/log/js/target modules/mtl/js/target modules/newrelic/target modules/log-odin/target modules/mtl/jvm/target modules/lightstep/target project/target

- name: Upload target directories
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/series/0.1')
Expand Down
30 changes: 16 additions & 14 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ lazy val root = tlCrossRootProject.aggregate(
mtl,
noop,
xray,
logOdin,
examples
)

Expand Down Expand Up @@ -316,20 +317,21 @@ lazy val examples = project
)
)

// lazy val logOdin = project
// .in(file("modules/log-odin"))
// .dependsOn(core.jvm)
// .enablePlugins(AutomateHeaderPlugin)
// // .settings(
// publish / skip := scalaVersion.value.startsWith("3."),
// name := "natchez-log-odin",
// description := "Logging bindings for Natchez, using Odin.",
// libraryDependencies ++= Seq(
// "io.circe" %% "circe-core" % "0.14.0",
// "com.github.valskalla" %% "odin-core" % "0.9.1",
// "com.github.valskalla" %% "odin-json" % "0.9.1"
// ).filterNot(_ => scalaVersion.value.startsWith("3."))
// )
lazy val logOdin = project
.in(file("modules/log-odin"))
.dependsOn(core.jvm)
.enablePlugins(AutomateHeaderPlugin)
.settings(commonSettings)
.settings(
name := "natchez-log-odin",
description := "Logging bindings for Natchez, using Odin.",
tlVersionIntroduced := List("2.12", "2.13", "3").map(_ -> "0.1.7").toMap,
libraryDependencies ++= Seq(
"io.circe" %% "circe-core" % "0.14.1",
"com.github.valskalla" %% "odin-core" % "0.13.0",
"com.github.valskalla" %% "odin-json" % "0.13.0"
)
)

lazy val docs = project
.in(file("modules/docs"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private[logodin] final case class LogSpan[F[_]: Sync: Logger](
exitCase match {
case Succeeded => List("exit.case" -> "completed".asJson)
case Canceled => List("exit.case" -> "canceled".asJson)
case Errored(ex: Fields) => exitFields(ex) ++ ex.fields.toList.map(_.map(_.asJson))
case Errored(ex: Fields) => exitFields(ex) ++ ex.fields.toList.map(_.fmap(_.asJson))
case Errored(ex) => exitFields(ex)
}
} ++ fs ++ List("children" -> cs.reverse.map(Json.fromJsonObject).asJson)
Expand Down Expand Up @@ -213,4 +213,4 @@ private[logodin] object LogSpan {
fromKernel(service, name, kernel).recoverWith {
case _: NoSuchElementException => root(service, name)
}
}
}