]> Git Repo - J-u-boot.git/blobdiff - common/log_console.c
rmobile: Drop CONFIG_SH73A0 and associated code
[J-u-boot.git] / common / log_console.c
index 8776fd4703917f8ca1c0ae2d3be1949809fb9531..f1dcc04b97c915668613ee15959dae53247d8d15 100644 (file)
@@ -8,12 +8,14 @@
 
 #include <common.h>
 #include <log.h>
+#include <asm/global_data.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
 static int log_console_emit(struct log_device *ldev, struct log_rec *rec)
 {
        int fmt = gd->log_fmt;
+       bool add_space = false;
 
        /*
         * The output format is designed to give someone a fighting chance of
@@ -25,18 +27,21 @@ static int log_console_emit(struct log_device *ldev, struct log_rec *rec)
         *    - function is an identifier and ends with ()
         *    - message has a space before it unless it is on its own
         */
-       if (fmt & BIT(LOGF_LEVEL))
-               printf("%s.", log_get_level_name(rec->level));
-       if (fmt & BIT(LOGF_CAT))
-               printf("%s,", log_get_cat_name(rec->cat));
-       if (fmt & BIT(LOGF_FILE))
-               printf("%s:", rec->file);
-       if (fmt & BIT(LOGF_LINE))
-               printf("%d-", rec->line);
-       if (fmt & BIT(LOGF_FUNC))
-               printf("%s()", rec->func);
+       if (!(rec->flags & LOGRECF_CONT) && fmt != BIT(LOGF_MSG)) {
+               add_space = true;
+               if (fmt & BIT(LOGF_LEVEL))
+                       printf("%s.", log_get_level_name(rec->level));
+               if (fmt & BIT(LOGF_CAT))
+                       printf("%s,", log_get_cat_name(rec->cat));
+               if (fmt & BIT(LOGF_FILE))
+                       printf("%s:", rec->file);
+               if (fmt & BIT(LOGF_LINE))
+                       printf("%d-", rec->line);
+               if (fmt & BIT(LOGF_FUNC))
+                       printf("%*s()", CONFIG_LOGF_FUNC_PAD, rec->func);
+       }
        if (fmt & BIT(LOGF_MSG))
-               printf("%s%s", fmt != BIT(LOGF_MSG) ? " " : "", rec->msg);
+               printf("%s%s", add_space ? " " : "", rec->msg);
 
        return 0;
 }
This page took 0.026928 seconds and 4 git commands to generate.