new test main with code directly (fixes)
This commit is contained in:
+62
@@ -0,0 +1,62 @@
|
||||
declare host LowLog {
|
||||
[Host(module = "log", name = "write", version = 1)]
|
||||
[Capability(name = "log")]
|
||||
fn write(level: int, message: str) -> void;
|
||||
|
||||
[Host(module = "log", name = "write_tag", version = 1)]
|
||||
[Capability(name = "log")]
|
||||
fn write_tag(level: int, tag: int, message: str) -> void;
|
||||
}
|
||||
|
||||
declare service Log
|
||||
{
|
||||
fn trace(msg: str) -> void
|
||||
{
|
||||
LowLog.write(0, msg);
|
||||
}
|
||||
|
||||
fn debug(msg: str) -> void
|
||||
{
|
||||
LowLog.write(1, msg);
|
||||
}
|
||||
|
||||
fn info(msg: str) -> void
|
||||
{
|
||||
LowLog.write(2, msg);
|
||||
}
|
||||
|
||||
fn warn(msg: str) -> void
|
||||
{
|
||||
LowLog.write(3, msg);
|
||||
}
|
||||
|
||||
fn error(msg: str) -> void
|
||||
{
|
||||
LowLog.write(4, msg);
|
||||
}
|
||||
|
||||
fn trace(tag: int, msg: str) -> void
|
||||
{
|
||||
LowLog.write_tag(0, tag, msg);
|
||||
}
|
||||
|
||||
fn debug(tag: int, msg: str) -> void
|
||||
{
|
||||
LowLog.write_tag(1, tag, msg);
|
||||
}
|
||||
|
||||
fn info(tag: int, msg: str) -> void
|
||||
{
|
||||
LowLog.write_tag(2, tag, msg);
|
||||
}
|
||||
|
||||
fn warn(tag: int, msg: str) -> void
|
||||
{
|
||||
LowLog.write_tag(3, tag, msg);
|
||||
}
|
||||
|
||||
fn error(tag: int, msg: str) -> void
|
||||
{
|
||||
LowLog.write_tag(4, tag, msg);
|
||||
}
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
mod host LowLog;
|
||||
pub service Log;
|
||||
Reference in New Issue
Block a user