Index: uspace/lib/c/generic/assert.c
===================================================================
--- uspace/lib/c/generic/assert.c	(revision 207533f656c8eb4d9d0fbf36bc55a1c06a3316bb)
+++ uspace/lib/c/generic/assert.c	(revision eef1b0317f3802b67fa2a31033fa2973fbaab4e7)
@@ -39,36 +39,14 @@
 #include <stdint.h>
 
-#define MSG_START	"Assertion failed ("
-#define MSG_FILE	") in file \""
-#define MSG_LINE	"\", line "
-#define MSG_END		".\n"
-
-static atomic_t failed_asserts;
+static atomic_t failed_asserts = {0};
 
 void assert_abort(const char *cond, const char *file, unsigned int line)
 {
-	char lstr[11];
-	char *pd = &lstr[10];
-	uint32_t ln = (uint32_t) line;
-
-	/*
-	 * Convert ln to a zero-terminated string.
-	 */
-	*pd-- = 0;
-	for (; ln; ln /= 10)
-		*pd-- = '0' + ln % 10;
-	pd++;
-
 	/*
 	 * Send the message safely to klog. Nested asserts should not occur.
 	 */
-	klog_write(MSG_START, str_size(MSG_START));
-	klog_write(cond, str_size(cond));
-	klog_write(MSG_FILE, str_size(MSG_FILE));
-	klog_write(file, str_size(file));
-	klog_write(MSG_LINE, str_size(MSG_LINE));
-	klog_write(pd, str_size(pd));
-	klog_write(MSG_END, str_size(MSG_END));
-
+	klog_printf("Assertion failed (%s) in file \"%s\", line %u.\n",
+	    cond, file, line);
+	
 	/*
 	 * Check if this is a nested or parallel assert.
@@ -82,8 +60,8 @@
 	 * assertions.
 	 */
-	printf(MSG_START "%s" MSG_FILE "%s" MSG_LINE "%u" MSG_END,
+	printf("Assertion failed (%s) in file \"%s\", line %u.\n",
 	    cond, file, line);
 	stacktrace_print();
-
+	
 	abort();
 }
Index: uspace/lib/c/generic/io/klog.c
===================================================================
--- uspace/lib/c/generic/io/klog.c	(revision 207533f656c8eb4d9d0fbf36bc55a1c06a3316bb)
+++ uspace/lib/c/generic/io/klog.c	(revision eef1b0317f3802b67fa2a31033fa2973fbaab4e7)
@@ -38,5 +38,7 @@
 #include <sys/types.h>
 #include <unistd.h>
+#include <errno.h>
 #include <io/klog.h>
+#include <io/printf_core.h>
 
 size_t klog_write(const void *buf, size_t size)
@@ -55,4 +57,67 @@
 }
 
+/** Print formatted text to klog.
+ *
+ * @param fmt Format string
+ *
+ * \see For more details about format string see printf_core.
+ *
+ */
+int klog_printf(const char *fmt, ...)
+{
+	va_list args;
+	va_start(args, fmt);
+	
+	int ret = klog_vprintf(fmt, args);
+	
+	va_end(args);
+	
+	return ret;
+}
+
+static int klog_vprintf_str_write(const char *str, size_t size, void *data)
+{
+	size_t wr = klog_write(str, size);
+	return str_nlength(str, wr);
+}
+
+static int klog_vprintf_wstr_write(const wchar_t *str, size_t size, void *data)
+{
+	size_t offset = 0;
+	size_t chars = 0;
+	
+	while (offset < size) {
+		char buf[STR_BOUNDS(1)];
+		size_t sz = 0;
+		
+		if (chr_encode(str[chars], buf, &sz, STR_BOUNDS(1)) == EOK)
+			klog_write(buf, sz);
+		
+		chars++;
+		offset += sizeof(wchar_t);
+	}
+	
+	return chars;
+}
+
+/** Print formatted text to klog.
+ *
+ * @param fmt Format string
+ * @param ap  Format parameters
+ *
+ * \see For more details about format string see printf_core.
+ *
+ */
+int klog_vprintf(const char *fmt, va_list ap)
+{
+	printf_spec_t ps = {
+		klog_vprintf_str_write,
+		klog_vprintf_wstr_write,
+		NULL
+	};
+	
+	return printf_core(fmt, &ps, ap);
+}
+
 /** @}
  */
Index: uspace/lib/c/generic/io/vprintf.c
===================================================================
--- uspace/lib/c/generic/io/vprintf.c	(revision 207533f656c8eb4d9d0fbf36bc55a1c06a3316bb)
+++ uspace/lib/c/generic/io/vprintf.c	(revision eef1b0317f3802b67fa2a31033fa2973fbaab4e7)
@@ -96,7 +96,6 @@
 /** Print formatted text to stdout.
  *
- * @param file Output stream
- * @param fmt  Format string
- * @param ap   Format parameters
+ * @param fmt Format string
+ * @param ap  Format parameters
  *
  * \see For more details about format string see printf_core.
Index: uspace/lib/c/include/assert.h
===================================================================
--- uspace/lib/c/include/assert.h	(revision 207533f656c8eb4d9d0fbf36bc55a1c06a3316bb)
+++ uspace/lib/c/include/assert.h	(revision eef1b0317f3802b67fa2a31033fa2973fbaab4e7)
@@ -64,5 +64,4 @@
     __attribute__((noreturn));
 
-
 #endif
 
Index: uspace/lib/c/include/io/klog.h
===================================================================
--- uspace/lib/c/include/io/klog.h	(revision 207533f656c8eb4d9d0fbf36bc55a1c06a3316bb)
+++ uspace/lib/c/include/io/klog.h	(revision eef1b0317f3802b67fa2a31033fa2973fbaab4e7)
@@ -37,7 +37,10 @@
 
 #include <sys/types.h>
+#include <stdarg.h>
 
 extern size_t klog_write(const void *, size_t);
 extern void klog_update(void);
+extern int klog_printf(const char *, ...);
+extern int klog_vprintf(const char *, va_list);
 
 #endif
