1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use log::trace;

use crate::config::get_config_context;
use crate::context::auto_register_context::get_auto_register_context;
use crate::core::Error;
use crate::core::runner::Runner;
use crate::logger::init_logger;

pub mod core;
pub mod context;
pub mod app;
pub mod logger;
pub mod config;

pub async fn vine_run() -> Result<(), Error> {
    let context = get_config_context()?;
    init_logger(&context)?;

    trace!("Setup - create App");
    let app = app::App::default();

    trace!("Setup - adding {} to App", &context);
    app.add_context(context);

    let context = get_auto_register_context()?;
    trace!("Setup - adding {} to App", &context);
    app.add_context(context);

    trace!("Setup - run App");
    app.run().await
}