Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 2 | /* |
| 3 | * Logging support |
| 4 | * |
| 5 | * Copyright (c) 2017 Google, Inc |
| 6 | * Written by Simon Glass <sjg@chromium.org> |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #include <common.h> |
| 10 | #include <log.h> |
| 11 | #include <malloc.h> |
Simon Glass | f941c8d | 2017-12-28 13:14:16 -0700 | [diff] [blame] | 12 | #include <dm/uclass.h> |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 13 | |
| 14 | DECLARE_GLOBAL_DATA_PTR; |
| 15 | |
Sean Anderson | 4338140 | 2020-10-27 19:55:22 -0400 | [diff] [blame] | 16 | static const char *const log_cat_name[] = { |
Simon Glass | f941c8d | 2017-12-28 13:14:16 -0700 | [diff] [blame] | 17 | "none", |
| 18 | "arch", |
| 19 | "board", |
| 20 | "core", |
| 21 | "driver-model", |
| 22 | "device-tree", |
Heinrich Schuchardt | 1973b38 | 2018-01-22 20:10:45 +0100 | [diff] [blame] | 23 | "efi", |
Simon Glass | 8021296 | 2020-09-27 18:46:13 -0600 | [diff] [blame] | 24 | "alloc", |
| 25 | "sandbox", |
| 26 | "bloblist", |
| 27 | "devres", |
| 28 | "acpi", |
Simon Glass | f941c8d | 2017-12-28 13:14:16 -0700 | [diff] [blame] | 29 | }; |
| 30 | |
Heinrich Schuchardt | 2a0cbf3 | 2020-10-23 13:00:01 +0200 | [diff] [blame] | 31 | _Static_assert(ARRAY_SIZE(log_cat_name) == LOGC_COUNT - LOGC_NONE, |
| 32 | "log_cat_name size"); |
| 33 | |
Sean Anderson | 4338140 | 2020-10-27 19:55:22 -0400 | [diff] [blame] | 34 | static const char *const log_level_name[] = { |
Simon Glass | f941c8d | 2017-12-28 13:14:16 -0700 | [diff] [blame] | 35 | "EMERG", |
| 36 | "ALERT", |
| 37 | "CRIT", |
| 38 | "ERR", |
| 39 | "WARNING", |
| 40 | "NOTICE", |
| 41 | "INFO", |
| 42 | "DEBUG", |
| 43 | "CONTENT", |
| 44 | "IO", |
| 45 | }; |
| 46 | |
Heinrich Schuchardt | 2a0cbf3 | 2020-10-23 13:00:01 +0200 | [diff] [blame] | 47 | _Static_assert(ARRAY_SIZE(log_level_name) == LOGL_COUNT, "log_level_name size"); |
| 48 | |
| 49 | /* All error responses MUST begin with '<' */ |
Simon Glass | f941c8d | 2017-12-28 13:14:16 -0700 | [diff] [blame] | 50 | const char *log_get_cat_name(enum log_category_t cat) |
| 51 | { |
Simon Glass | c2e4e7e | 2018-06-12 00:04:55 -0600 | [diff] [blame] | 52 | const char *name; |
| 53 | |
| 54 | if (cat < 0 || cat >= LOGC_COUNT) |
| 55 | return "<invalid>"; |
Simon Glass | f941c8d | 2017-12-28 13:14:16 -0700 | [diff] [blame] | 56 | if (cat >= LOGC_NONE) |
| 57 | return log_cat_name[cat - LOGC_NONE]; |
| 58 | |
Heinrich Schuchardt | 6c9e417 | 2020-06-08 18:04:22 +0200 | [diff] [blame] | 59 | #if CONFIG_IS_ENABLED(DM) |
Simon Glass | c2e4e7e | 2018-06-12 00:04:55 -0600 | [diff] [blame] | 60 | name = uclass_get_name((enum uclass_id)cat); |
Heinrich Schuchardt | 6c9e417 | 2020-06-08 18:04:22 +0200 | [diff] [blame] | 61 | #else |
| 62 | name = NULL; |
| 63 | #endif |
Simon Glass | c2e4e7e | 2018-06-12 00:04:55 -0600 | [diff] [blame] | 64 | |
| 65 | return name ? name : "<missing>"; |
Simon Glass | f941c8d | 2017-12-28 13:14:16 -0700 | [diff] [blame] | 66 | } |
| 67 | |
| 68 | enum log_category_t log_get_cat_by_name(const char *name) |
| 69 | { |
| 70 | enum uclass_id id; |
| 71 | int i; |
| 72 | |
| 73 | for (i = LOGC_NONE; i < LOGC_COUNT; i++) |
| 74 | if (!strcmp(name, log_cat_name[i - LOGC_NONE])) |
| 75 | return i; |
| 76 | id = uclass_get_by_name(name); |
| 77 | if (id != UCLASS_INVALID) |
| 78 | return (enum log_category_t)id; |
| 79 | |
| 80 | return LOGC_NONE; |
| 81 | } |
| 82 | |
| 83 | const char *log_get_level_name(enum log_level_t level) |
| 84 | { |
| 85 | if (level >= LOGL_COUNT) |
| 86 | return "INVALID"; |
| 87 | return log_level_name[level]; |
| 88 | } |
| 89 | |
| 90 | enum log_level_t log_get_level_by_name(const char *name) |
| 91 | { |
| 92 | int i; |
| 93 | |
| 94 | for (i = 0; i < LOGL_COUNT; i++) { |
| 95 | if (!strcasecmp(log_level_name[i], name)) |
| 96 | return i; |
| 97 | } |
| 98 | |
| 99 | return LOGL_NONE; |
| 100 | } |
| 101 | |
Sean Anderson | 3102c1d | 2020-10-27 19:55:24 -0400 | [diff] [blame] | 102 | struct log_device *log_device_find_by_name(const char *drv_name) |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 103 | { |
| 104 | struct log_device *ldev; |
| 105 | |
| 106 | list_for_each_entry(ldev, &gd->log_head, sibling_node) { |
| 107 | if (!strcmp(drv_name, ldev->drv->name)) |
| 108 | return ldev; |
| 109 | } |
| 110 | |
| 111 | return NULL; |
| 112 | } |
| 113 | |
Sean Anderson | 3102c1d | 2020-10-27 19:55:24 -0400 | [diff] [blame] | 114 | bool log_has_cat(enum log_category_t cat_list[], enum log_category_t cat) |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 115 | { |
| 116 | int i; |
| 117 | |
| 118 | for (i = 0; i < LOGF_MAX_CATEGORIES && cat_list[i] != LOGC_END; i++) { |
| 119 | if (cat_list[i] == cat) |
| 120 | return true; |
| 121 | } |
| 122 | |
| 123 | return false; |
| 124 | } |
| 125 | |
Sean Anderson | 3102c1d | 2020-10-27 19:55:24 -0400 | [diff] [blame] | 126 | bool log_has_file(const char *file_list, const char *file) |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 127 | { |
| 128 | int file_len = strlen(file); |
| 129 | const char *s, *p; |
| 130 | int substr_len; |
| 131 | |
| 132 | for (s = file_list; *s; s = p + (*p != '\0')) { |
| 133 | p = strchrnul(s, ','); |
| 134 | substr_len = p - s; |
| 135 | if (file_len >= substr_len && |
| 136 | !strncmp(file + file_len - substr_len, s, substr_len)) |
| 137 | return true; |
| 138 | } |
| 139 | |
| 140 | return false; |
| 141 | } |
| 142 | |
| 143 | /** |
| 144 | * log_passes_filters() - check if a log record passes the filters for a device |
| 145 | * |
| 146 | * @ldev: Log device to check |
| 147 | * @rec: Log record to check |
| 148 | * @return true if @rec is not blocked by the filters in @ldev, false if it is |
| 149 | */ |
| 150 | static bool log_passes_filters(struct log_device *ldev, struct log_rec *rec) |
| 151 | { |
| 152 | struct log_filter *filt; |
| 153 | |
Simon Glass | 52d3df7 | 2020-09-12 11:13:34 -0600 | [diff] [blame] | 154 | if (rec->force_debug) |
| 155 | return true; |
| 156 | |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 157 | /* If there are no filters, filter on the default log level */ |
| 158 | if (list_empty(&ldev->filter_head)) { |
| 159 | if (rec->level > gd->default_log_level) |
| 160 | return false; |
| 161 | return true; |
| 162 | } |
| 163 | |
| 164 | list_for_each_entry(filt, &ldev->filter_head, sibling_node) { |
Sean Anderson | 40455a6 | 2020-10-27 19:55:30 -0400 | [diff] [blame^] | 165 | if (filt->flags & LOGFF_LEVEL_MIN) { |
| 166 | if (rec->level < filt->level) |
| 167 | continue; |
| 168 | } else if (rec->level > filt->level) { |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 169 | continue; |
Sean Anderson | 40455a6 | 2020-10-27 19:55:30 -0400 | [diff] [blame^] | 170 | } |
| 171 | |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 172 | if ((filt->flags & LOGFF_HAS_CAT) && |
| 173 | !log_has_cat(filt->cat_list, rec->cat)) |
| 174 | continue; |
Sean Anderson | 40455a6 | 2020-10-27 19:55:30 -0400 | [diff] [blame^] | 175 | |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 176 | if (filt->file_list && |
| 177 | !log_has_file(filt->file_list, rec->file)) |
| 178 | continue; |
Sean Anderson | fe3b1a2 | 2020-10-27 19:55:26 -0400 | [diff] [blame] | 179 | |
| 180 | if (filt->flags & LOGFF_DENY) |
| 181 | return false; |
| 182 | else |
| 183 | return true; |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 184 | } |
| 185 | |
| 186 | return false; |
| 187 | } |
| 188 | |
| 189 | /** |
| 190 | * log_dispatch() - Send a log record to all log devices for processing |
| 191 | * |
| 192 | * The log record is sent to each log device in turn, skipping those which have |
Heinrich Schuchardt | d094a07 | 2020-10-17 14:31:58 +0200 | [diff] [blame] | 193 | * filters which block the record. |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 194 | * |
Heinrich Schuchardt | d094a07 | 2020-10-17 14:31:58 +0200 | [diff] [blame] | 195 | * All log messages created while processing log record @rec are ignored. |
| 196 | * |
| 197 | * @rec: log record to dispatch |
| 198 | * Return: 0 msg sent, 1 msg not sent while already dispatching another msg |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 199 | */ |
| 200 | static int log_dispatch(struct log_rec *rec) |
| 201 | { |
| 202 | struct log_device *ldev; |
| 203 | |
Heinrich Schuchardt | e5b35f7 | 2020-09-14 10:01:00 +0200 | [diff] [blame] | 204 | /* |
| 205 | * When a log driver writes messages (e.g. via the network stack) this |
| 206 | * may result in further generated messages. We cannot process them here |
| 207 | * as this might result in infinite recursion. |
| 208 | */ |
Heinrich Schuchardt | 993a06b | 2020-10-17 14:31:57 +0200 | [diff] [blame] | 209 | if (gd->processing_msg) |
Heinrich Schuchardt | d094a07 | 2020-10-17 14:31:58 +0200 | [diff] [blame] | 210 | return 1; |
Heinrich Schuchardt | e5b35f7 | 2020-09-14 10:01:00 +0200 | [diff] [blame] | 211 | |
| 212 | /* Emit message */ |
Heinrich Schuchardt | 993a06b | 2020-10-17 14:31:57 +0200 | [diff] [blame] | 213 | gd->processing_msg = true; |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 214 | list_for_each_entry(ldev, &gd->log_head, sibling_node) { |
Simon Glass | b452030 | 2020-09-12 12:28:47 -0600 | [diff] [blame] | 215 | if ((ldev->flags & LOGDF_ENABLE) && |
| 216 | log_passes_filters(ldev, rec)) |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 217 | ldev->drv->emit(ldev, rec); |
| 218 | } |
Heinrich Schuchardt | 993a06b | 2020-10-17 14:31:57 +0200 | [diff] [blame] | 219 | gd->processing_msg = false; |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 220 | return 0; |
| 221 | } |
| 222 | |
| 223 | int _log(enum log_category_t cat, enum log_level_t level, const char *file, |
| 224 | int line, const char *func, const char *fmt, ...) |
| 225 | { |
| 226 | char buf[CONFIG_SYS_CBSIZE]; |
| 227 | struct log_rec rec; |
| 228 | va_list args; |
| 229 | |
Heinrich Schuchardt | d094a07 | 2020-10-17 14:31:58 +0200 | [diff] [blame] | 230 | /* Check for message continuation */ |
| 231 | if (cat == LOGC_CONT) |
| 232 | cat = gd->logc_prev; |
| 233 | if (level == LOGL_CONT) |
| 234 | level = gd->logl_prev; |
| 235 | |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 236 | rec.cat = cat; |
Simon Glass | 52d3df7 | 2020-09-12 11:13:34 -0600 | [diff] [blame] | 237 | rec.level = level & LOGL_LEVEL_MASK; |
| 238 | rec.force_debug = level & LOGL_FORCE_DEBUG; |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 239 | rec.file = file; |
| 240 | rec.line = line; |
| 241 | rec.func = func; |
| 242 | va_start(args, fmt); |
| 243 | vsnprintf(buf, sizeof(buf), fmt, args); |
| 244 | va_end(args); |
| 245 | rec.msg = buf; |
| 246 | if (!gd || !(gd->flags & GD_FLG_LOG_READY)) { |
| 247 | if (gd) |
| 248 | gd->log_drop_count++; |
| 249 | return -ENOSYS; |
| 250 | } |
Heinrich Schuchardt | d094a07 | 2020-10-17 14:31:58 +0200 | [diff] [blame] | 251 | if (!log_dispatch(&rec)) { |
| 252 | gd->logc_prev = cat; |
| 253 | gd->logl_prev = level; |
| 254 | } |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 255 | |
| 256 | return 0; |
| 257 | } |
| 258 | |
Sean Anderson | a02f84e | 2020-10-27 19:55:25 -0400 | [diff] [blame] | 259 | int log_add_filter_flags(const char *drv_name, enum log_category_t cat_list[], |
Sean Anderson | 40455a6 | 2020-10-27 19:55:30 -0400 | [diff] [blame^] | 260 | enum log_level_t level, const char *file_list, |
Sean Anderson | a02f84e | 2020-10-27 19:55:25 -0400 | [diff] [blame] | 261 | int flags) |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 262 | { |
| 263 | struct log_filter *filt; |
| 264 | struct log_device *ldev; |
Simon Glass | 45fac9f | 2018-04-02 02:42:39 -0600 | [diff] [blame] | 265 | int ret; |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 266 | int i; |
| 267 | |
| 268 | ldev = log_device_find_by_name(drv_name); |
| 269 | if (!ldev) |
| 270 | return -ENOENT; |
Heinrich Schuchardt | c1f39ed | 2020-04-19 10:48:36 +0200 | [diff] [blame] | 271 | filt = calloc(1, sizeof(*filt)); |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 272 | if (!filt) |
| 273 | return -ENOMEM; |
| 274 | |
Sean Anderson | a02f84e | 2020-10-27 19:55:25 -0400 | [diff] [blame] | 275 | filt->flags = flags; |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 276 | if (cat_list) { |
| 277 | filt->flags |= LOGFF_HAS_CAT; |
| 278 | for (i = 0; ; i++) { |
Simon Glass | 45fac9f | 2018-04-02 02:42:39 -0600 | [diff] [blame] | 279 | if (i == ARRAY_SIZE(filt->cat_list)) { |
| 280 | ret = -ENOSPC; |
| 281 | goto err; |
| 282 | } |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 283 | filt->cat_list[i] = cat_list[i]; |
| 284 | if (cat_list[i] == LOGC_END) |
| 285 | break; |
| 286 | } |
| 287 | } |
Sean Anderson | 40455a6 | 2020-10-27 19:55:30 -0400 | [diff] [blame^] | 288 | filt->level = level; |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 289 | if (file_list) { |
| 290 | filt->file_list = strdup(file_list); |
Simon Glass | 45fac9f | 2018-04-02 02:42:39 -0600 | [diff] [blame] | 291 | if (!filt->file_list) { |
Sean Anderson | 69529f9 | 2020-10-27 19:55:20 -0400 | [diff] [blame] | 292 | ret = -ENOMEM; |
Simon Glass | 45fac9f | 2018-04-02 02:42:39 -0600 | [diff] [blame] | 293 | goto err; |
| 294 | } |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 295 | } |
| 296 | filt->filter_num = ldev->next_filter_num++; |
Sean Anderson | fe3b1a2 | 2020-10-27 19:55:26 -0400 | [diff] [blame] | 297 | /* Add deny filters to the beginning of the list */ |
| 298 | if (flags & LOGFF_DENY) |
| 299 | list_add(&filt->sibling_node, &ldev->filter_head); |
| 300 | else |
| 301 | list_add_tail(&filt->sibling_node, &ldev->filter_head); |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 302 | |
| 303 | return filt->filter_num; |
| 304 | |
Simon Glass | 45fac9f | 2018-04-02 02:42:39 -0600 | [diff] [blame] | 305 | err: |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 306 | free(filt); |
Simon Glass | 45fac9f | 2018-04-02 02:42:39 -0600 | [diff] [blame] | 307 | return ret; |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 308 | } |
| 309 | |
| 310 | int log_remove_filter(const char *drv_name, int filter_num) |
| 311 | { |
| 312 | struct log_filter *filt; |
| 313 | struct log_device *ldev; |
| 314 | |
| 315 | ldev = log_device_find_by_name(drv_name); |
| 316 | if (!ldev) |
| 317 | return -ENOENT; |
| 318 | |
| 319 | list_for_each_entry(filt, &ldev->filter_head, sibling_node) { |
| 320 | if (filt->filter_num == filter_num) { |
| 321 | list_del(&filt->sibling_node); |
| 322 | free(filt); |
| 323 | |
| 324 | return 0; |
| 325 | } |
| 326 | } |
| 327 | |
| 328 | return -ENOENT; |
| 329 | } |
| 330 | |
Simon Glass | 3d03ab6 | 2020-09-12 12:28:49 -0600 | [diff] [blame] | 331 | /** |
| 332 | * log_find_device_by_drv() - Find a device by its driver |
| 333 | * |
| 334 | * @drv: Log driver |
| 335 | * @return Device associated with that driver, or NULL if not found |
| 336 | */ |
| 337 | static struct log_device *log_find_device_by_drv(struct log_driver *drv) |
| 338 | { |
| 339 | struct log_device *ldev; |
| 340 | |
| 341 | list_for_each_entry(ldev, &gd->log_head, sibling_node) { |
| 342 | if (ldev->drv == drv) |
| 343 | return ldev; |
| 344 | } |
| 345 | /* |
| 346 | * It is quite hard to pass an invalid driver since passing an unknown |
| 347 | * LOG_GET_DRIVER(xxx) would normally produce a compilation error. But |
| 348 | * it is possible to pass NULL, for example, so this |
| 349 | */ |
| 350 | |
| 351 | return NULL; |
| 352 | } |
| 353 | |
| 354 | int log_device_set_enable(struct log_driver *drv, bool enable) |
| 355 | { |
| 356 | struct log_device *ldev; |
| 357 | |
| 358 | ldev = log_find_device_by_drv(drv); |
| 359 | if (!ldev) |
| 360 | return -ENOENT; |
| 361 | if (enable) |
| 362 | ldev->flags |= LOGDF_ENABLE; |
| 363 | else |
| 364 | ldev->flags &= ~LOGDF_ENABLE; |
| 365 | |
| 366 | return 0; |
| 367 | } |
| 368 | |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 369 | int log_init(void) |
| 370 | { |
| 371 | struct log_driver *drv = ll_entry_start(struct log_driver, log_driver); |
| 372 | const int count = ll_entry_count(struct log_driver, log_driver); |
| 373 | struct log_driver *end = drv + count; |
| 374 | |
| 375 | /* |
| 376 | * We cannot add runtime data to the driver since it is likely stored |
| 377 | * in rodata. Instead, set up a 'device' corresponding to each driver. |
| 378 | * We only support having a single device. |
| 379 | */ |
| 380 | INIT_LIST_HEAD((struct list_head *)&gd->log_head); |
| 381 | while (drv < end) { |
| 382 | struct log_device *ldev; |
| 383 | |
| 384 | ldev = calloc(1, sizeof(*ldev)); |
| 385 | if (!ldev) { |
| 386 | debug("%s: Cannot allocate memory\n", __func__); |
| 387 | return -ENOMEM; |
| 388 | } |
| 389 | INIT_LIST_HEAD(&ldev->filter_head); |
| 390 | ldev->drv = drv; |
Simon Glass | b452030 | 2020-09-12 12:28:47 -0600 | [diff] [blame] | 391 | ldev->flags = drv->flags; |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 392 | list_add_tail(&ldev->sibling_node, |
| 393 | (struct list_head *)&gd->log_head); |
| 394 | drv++; |
| 395 | } |
Simon Glass | af1bc0c | 2017-12-04 13:48:28 -0700 | [diff] [blame] | 396 | gd->flags |= GD_FLG_LOG_READY; |
Simon Glass | 2b1dc29 | 2018-10-01 11:55:11 -0600 | [diff] [blame] | 397 | if (!gd->default_log_level) |
Simon Glass | f0b05c9 | 2019-02-16 20:24:35 -0700 | [diff] [blame] | 398 | gd->default_log_level = CONFIG_LOG_DEFAULT_LEVEL; |
Heinrich Schuchardt | 3c21d77 | 2020-06-17 21:52:44 +0200 | [diff] [blame] | 399 | gd->log_fmt = log_get_default_format(); |
Heinrich Schuchardt | d094a07 | 2020-10-17 14:31:58 +0200 | [diff] [blame] | 400 | gd->logc_prev = LOGC_NONE; |
| 401 | gd->logl_prev = LOGL_INFO; |
Simon Glass | e9c8d49 | 2017-12-04 13:48:24 -0700 | [diff] [blame] | 402 | |
| 403 | return 0; |
| 404 | } |