Hi guys, i'm trying to use injector directly via:
val myModules = CatsAppPlugin.modules.app[IO] ++
CatsAppPlugin.modules.repoProd[IO] ++
CatsModule ++
CatsAppPlugin.modules.configs ++
CatsAppPlugin.modules.api[IO] ++
CatsAppPlugin.modules.repoDummy[IO]
val plan = Injector().plan(myModules, Roots.Everything)
var ctx: Module[IO] = Injector().produce(myModules, Roots.Everything).unsafeGet().get[Module[IO]]
but I got an error
com.spread0x.http4s.service.UserServiceSpec *** ABORTED ***
izumi.distage.model.exceptions.ProvisioningException: Provisioner stopped after 1 instances, 5/64 operations failed:
- {type.izumi.distage.config.model.AppConfig} (CatsAppPlugin.scala:162), MissingInstanceException: Instance is not available in the object graph: {type.izumi.distage.config.model.AppConfig}.
Required by refs:
* {type.com.spread0x.config.PostgresCfg}
* {type.com.spread0x.config.PostgresPortCfg}
* {type.com.spread0x.config.ServerConfig}
How can I inject izumi.distage.config.model.AppConfig to fix the error?
com.spread0x.http4s.http.UserRoutesSpec *** ABORTED ***
izumi.distage.model.exceptions.ProvisioningException: Provisioner stopped after 1 instances, 4/65 operations failed:
- {type.org.http4s.client.Client[=λ %0 → IO[+0]]} (CatsAppPlugin.scala:86), IncompatibleEffectTypesException: Incompatible effect types: Can't execute effect in `λ %0 → cats.effect.IO[+0]` which is neither Identity, nor a subtype of the effect that Provisioner was launched in: `λ %0 → 0`
Hi all! I would like to ask about logstage with logback configuration.
Now I have json log in %msg
field with this setting: LogSinkLegacySlf4jImpl(LogstageCirceRenderingPolicy())
.
Is there some way to convert other slf4j logs (from other libraries) to logstage format to work with logback?
Or maybe you can tell me another way to use logstage api for json rendering with logback template
Or maybe you can tell me another way to use logstage api for json rendering with logback template
I'm not sure what exactly you want to do. We have logstage-sink-slf4j
which dumps logstage messages into slf4j. You may use it as a reference and implement your own logstage -> logback adapter
We also have logstage-adapter-slf4j
which works as an slf4j backend and forwards sl4j->logstage
LogSink
with google cloud logging APIs
Hey guys - what is the easiest way to change the output of the default IzLogger?
E.g. say instead of
[info] I 2020-08-21T11:00:23.984 (Main.scala:17) …foo.Main.runApplication [21:ioapp-compute-0] Pizza is great
I would like to have
[info] I 2020-08-21T11:00 (Main.scala:17) […foo.Main.runApplication] Pizza is great
How do do that?
0.10.19
, you can grab it once it gets on central https://dev.azure.com/7mind/izumi/_build/results?buildId=3089&view=results
trait OldOps[F[_]] {
//Monad Error
def old: F[Unit]
//....many methods
}
trait New[F[+_, +_]] {
def a: F[Throwable, Unit]
}
class NewImpl[F[+_, +_]: BIOMonadError](oldOps: OldOps[F]) extends New[F] {
def a: F[Throwable, Unit] = oldOps.old ???
}
addCompilerPlugin("org.typelevel" % "kind-projector" % "0.11.0" cross CrossVersion.full)
@hderms Do you mean to inject Some Specific JSON into ALL the log messages? You can attach context parameters to logger using IzLogger#apply
/IzLogger#withCustomContext
and all the messages from that logger will include these parameters (https://izumi.7mind.io/latest/release/doc/logstage/index.html#log-algebras):
val newLogger = logger("id" -> 1)
newLogger.info(s"abc cba")
// id=1 abc cba
In JSON the context fields will be under @context
key (https://izumi.7mind.io/latest/release/doc/logstage/index.html#overview)
And can be arbitrary JSON. You can customize the JSON for each type with LogstageCodec
implicit instances besides the default output
@micheal-hill You could try Java Serialization on a LightTypeTag
value. Alternatively, every monomorphic tag is representable as 2 strings + 2 ints, but there's no mechanism yet to recover it from an existing ParsedLightTypeTag
instance (sorry just hadn't thought about that ahead of time).
https://github.com/zio/izumi-reflect/blob/develop/izumi-reflect/izumi-reflect/src/main/scala/izumi/reflect/macrortti/LightTypeTag.scala#L249
You could make a PR for that to allow for efficient serialization/deserialization in new library version.
@an-tex
A lot of major changes and new features, most of them with some docs in the following sections:
Compile-time checks - https://izumi.7mind.io/distage/distage-framework.html#compile-time-checks
Mutators - https://izumi.7mind.io/distage/basics.html#mutator-bindings
New roles API - https://izumi.7mind.io/distage/distage-framework.html#roles
Compile-time plugin scanning (for Graal native and Scala.js) - https://izumi.7mind.io/distage/distage-framework.html#compile-time-scanning
Cats and BIO typeclasses for your effect type are now added to DI scope in distage automatically, you don’t have to add them manually to your ModuleDefs - https://izumi.7mind.io/distage/basics.html#out-of-the-box-typeclass-instances
Full release notes are indeed still pending...