'Understanding log.info()
Can you please explain what this log.info is doing here? Where can I see this log info for debugging purpose? In my existing project, it has been used at many places inside for loop. Thanks!
import java.io.{BufferedInputStream, FileInputStream}
import cats.instances.list._
import cats.syntax.contravariantSemigroupal._
import cats.syntax.flatMap._
import cats.syntax.parallel._
import com.google.api.client.util.{DateTime => GDateTime}
import com.google.api.services.storage.model.StorageObject
import com.google.cloud.storage.Storage
import com.leighperry.log4zio.Log.SafeLog
import zio.interop.catz._
import zio.{IO, Managed, ZIO}
def fileContentsToGcs(
cfg: AppConfig,
log: SafeLog[String],
filepath: String
): List[String] = {
val result: IO[FilesError, List[String]] =
for {
_ <- log.info(s"GCS file ${cfg.gcsBucketProject} ${cfg.gcsInputBucket} $filepath")
// list of csv files
contents <- expandedFileContents(log, cfg, filepath)
_ <- log.info(s"GCS temp files $contents")
} yield contents
unsafeRun(result)
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
