Index: uspace/drv/root/root.c
===================================================================
--- uspace/drv/root/root.c	(revision af6b515772b7e673b3f80cc8621a65997fed0821)
+++ uspace/drv/root/root.c	(revision fc51296af4f45da426f5626f3573adee6b0babda)
@@ -52,4 +52,5 @@
 
 #include <ddf/driver.h>
+#include <ddf/log.h>
 #include <devman.h>
 #include <ipc/devman.h>
@@ -89,11 +90,11 @@
 	int rc;
 
-	printf(NAME ": adding new function for virtual devices.\n");
-	printf(NAME ":   function node is `%s' (%d %s)\n", name,
+	ddf_msg(LVL_DEBUG, "Adding new function for virtual devices. "
+	    "Function node is `%s' (%d %s)\n", name,
 	    VIRTUAL_FUN_MATCH_SCORE, VIRTUAL_FUN_MATCH_ID);
 
 	fun = ddf_fun_create(dev, fun_inner, name);
 	if (fun == NULL) {
-		printf(NAME ": error creating function %s\n", name);
+		ddf_msg(LVL_ERROR, "Failed creating function %s\n", name);
 		return ENOMEM;
 	}
@@ -102,5 +103,5 @@
 	    VIRTUAL_FUN_MATCH_SCORE);
 	if (rc != EOK) {
-		printf(NAME ": error adding match IDs to function %s\n", name);
+		ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s\n", name);
 		ddf_fun_destroy(fun);
 		return rc;
@@ -109,5 +110,5 @@
 	rc = ddf_fun_bind(fun);
 	if (rc != EOK) {
-		printf(NAME ": error binding function %s: %s\n", name,
+		ddf_msg(LVL_ERROR, "Failed binding function %s: %s\n", name,
 		    str_error(rc));
 		ddf_fun_destroy(fun);
@@ -136,5 +137,5 @@
 	platform = sysinfo_get_data("platform", &platform_size);
 	if (platform == NULL) {
-		printf(NAME ": Failed to obtain platform name.\n");
+		ddf_msg(LVL_ERROR, "Failed to obtain platform name.\n");
 		return ENOENT;
 	}
@@ -143,5 +144,5 @@
 	platform = realloc(platform, platform_size + 1);
 	if (platform == NULL) {
-		printf(NAME ": Memory allocation failed.\n");
+		ddf_msg(LVL_ERROR, "Memory allocation failed.\n");
 		return ENOMEM;
 	}
@@ -151,16 +152,16 @@
 	/* Construct match ID. */
 	if (asprintf(&match_id, PLATFORM_FUN_MATCH_ID_FMT, platform) == -1) {
-		printf(NAME ": Memory allocation failed.\n");
+		ddf_msg(LVL_ERROR, "Memory allocation failed.\n");
 		return ENOMEM;
 	}
 
 	/* Add function. */
-	printf(NAME ": adding platform function\n");
-	printf(NAME ":   function node is `%s' (%d %s)\n", PLATFORM_FUN_NAME,
-	    PLATFORM_FUN_MATCH_SCORE, match_id);
+	ddf_msg(LVL_DEBUG, "Adding platform function. Function node is `%s' "
+	    " (%d %s)\n", PLATFORM_FUN_NAME, PLATFORM_FUN_MATCH_SCORE,
+	    match_id);
 
 	fun = ddf_fun_create(dev, fun_inner, name);
 	if (fun == NULL) {
-		printf(NAME ": error creating function %s\n", name);
+		ddf_msg(LVL_ERROR, "Error creating function %s\n", name);
 		return ENOMEM;
 	}
@@ -168,5 +169,6 @@
 	rc = ddf_fun_add_match_id(fun, match_id, PLATFORM_FUN_MATCH_SCORE);
 	if (rc != EOK) {
-		printf(NAME ": error adding match IDs to function %s\n", name);
+		ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s\n",
+		    name);
 		ddf_fun_destroy(fun);
 		return rc;
@@ -175,5 +177,5 @@
 	rc = ddf_fun_bind(fun);
 	if (rc != EOK) {
-		printf(NAME ": error binding function %s: %s\n", name,
+		ddf_msg(LVL_ERROR, "Failed binding function %s: %s\n", name,
 		    str_error(rc));
 		ddf_fun_destroy(fun);
@@ -191,5 +193,5 @@
 static int root_add_device(ddf_dev_t *dev)
 {
-	printf(NAME ": root_add_device, device handle=%" PRIun "\n",
+	ddf_msg(LVL_DEBUG, "root_add_device, device handle=%" PRIun "\n",
 	    dev->handle);
 
@@ -204,5 +206,5 @@
 	int res = add_platform_fun(dev);
 	if (EOK != res)
-		printf(NAME ": failed to add child device for platform.\n");
+		ddf_msg(LVL_ERROR, "Failed adding child device for platform.\n");
 
 	return res;
@@ -212,4 +214,6 @@
 {
 	printf(NAME ": HelenOS root device driver\n");
+
+	ddf_log_init(NAME, LVL_ERROR);
 	return ddf_driver_main(&root_driver);
 }
