I got seemingly simple problem.. and usually I could find a solution easily from stackoverflow, but I had no luck this time.
Here's problem. I have created a object in a package called com.kwoolytech.scalacommon
.
package com.kwoolytech.scalacommon
object Syslog {
def emergency(s: String) = { println("[Emergency] " + s) }
def alert(s: String) = { println("[Alert] " + s) }
def critical(s: String) = { println("[Critical] " + s) }
def error(s: String) = { println("[Error] " + s) }
def warning(s: String) = { println("[Warning] " + s) }
def notice(s: String) = { println("[Notice] " + s) }
def debug(s: String) = { println("[Debug] " + s) }
def info(s: String) = { println("[Info] " + s) }
}
All I want is to use this object in another package I've created.
package com.kwoolytech.kwoolybot
import com.kwoolytech.scalacommon.Syslog
class Dice(command: List[String], callback: List[String] => Unit) extends Bot {
override def run() = {
command.head match {
case "roll" => roll(command.tail, callback)
case _ => Syslog.debug(getClass + " Invalid command.")
}
}
I got a compile erorr,
object scalacommon is not a member of package com.kwoolytech
Both source files are located under a same project.
- Syslog.scala : src/scalacommon/syslog/Syslog.scala
- Dice.scala : src/main/dice/Dice.scala
Appreciate on your advice.