effect Logger {
    fn log(level: String, msg: String): Unit
    fn getLogLevel(): String
}

fn compute(): Int with {Logger} = {
    Logger.log("INFO", "Starting computation")
    let x = 10
    Logger.log("DEBUG", "Intermediate result: " + toString(x))
    let result = x * 2
    Logger.log("INFO", "Computation complete")
    result
}

handler prettyLogger: Logger {
    fn log(level, msg) = 
        {
    Console.print("[" + level + "] " + msg)
    resume(())
}
    fn getLogLevel() = resume("DEBUG")
}

fn main(): Unit with {Console} = {
    let result = run compute() with {
    Logger = prettyLogger,
}
    Console.print("Final result: " + toString(result))
}

let output = run main() with {}
