+void xbt_log_layout_set(xbt_log_category_t cat, xbt_log_layout_t lay) {
+ if (!cat->appender) {
+ WARN1("No appender to category %s. Setting the file appender as default",
+ cat->name);
+ xbt_log_appender_set(cat,xbt_log_appender_file_new(NULL));
+ }
+ if (cat->layout) {
+ if (cat->layout->free_) {
+ cat->layout->free_(cat->layout);
+ free(cat->layout);
+ }
+ }
+ cat->layout = lay;
+}