aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/scala/async/internal/AsyncUtils.scala
blob: 385cde4a6c9c88844c192d40a885f6367f4be8dd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/*
 * Copyright (C) 2012-2014 Typesafe Inc. <http://www.typesafe.com>
 */
package scala.async.internal

object AsyncUtils {


  private def enabled(level: String) = sys.props.getOrElse(s"scala.async.$level", "false").equalsIgnoreCase("true")

  private[async] val verbose = enabled("debug")
  private[async] val trace   = enabled("trace")

  @inline private[async] def vprintln(s: => Any): Unit = if (verbose) println(s"[async] $s")

  @inline private[async] def trace(s: => Any): Unit = if (trace) println(s"[async] $s")
}