|
1 | 1 | /// This module defines the `Module` struct, its builder struct, and methods on both structs. |
2 | 2 | use std::path::{Path, PathBuf}; |
3 | 3 |
|
| 4 | +use log::debug; |
4 | 5 | use regex::{Regex, RegexBuilder}; |
5 | 6 |
|
6 | 7 | use crate::Options; |
@@ -44,6 +45,8 @@ const REFERENCE_TEMPLATE: &str = include_str!("../data/templates/reference.adoc" |
44 | 45 | /// Construct a basic builder for `Module`, storing information from the user input. |
45 | 46 | impl Input { |
46 | 47 | pub fn new(mod_type: ModuleType, title: &str, options: &Options) -> Input { |
| 48 | + debug!("Processing title `{}` of type `{:?}`", title, mod_type); |
| 49 | + |
47 | 50 | let title = String::from(title); |
48 | 51 | let options = options.clone(); |
49 | 52 |
|
@@ -326,15 +329,24 @@ impl Input { |
326 | 329 | impl From<Input> for Module { |
327 | 330 | /// Convert the `Input` builder struct into the finished `Module` struct. |
328 | 331 | fn from(input: Input) -> Self { |
329 | | - Module { |
| 332 | + let module = Module { |
330 | 333 | mod_type: input.mod_type.clone(), |
331 | 334 | title: input.title.clone(), |
332 | 335 | id: input.id(), |
333 | 336 | file_name: input.file_name(), |
334 | 337 | include_statement: input.include_statement(), |
335 | 338 | includes: input.includes.clone(), |
336 | 339 | text: input.text(), |
337 | | - } |
| 340 | + }; |
| 341 | + |
| 342 | + debug!("Generated module properties:"); |
| 343 | + debug!("Type: {:?}", &module.mod_type); |
| 344 | + debug!("ID: {}", &module.id); |
| 345 | + debug!("File name: {}", &module.file_name); |
| 346 | + debug!("Include statement: {}", &module.include_statement); |
| 347 | + debug!("Included modules: {}", if let Some(includes) = &module.includes {includes.join(", ")} else {"none".to_string()} ); |
| 348 | + |
| 349 | + module |
338 | 350 | } |
339 | 351 | } |
340 | 352 |
|
|
0 commit comments