@@ -9,7 +9,7 @@ use std::{
9
9
use color_eyre:: owo_colors:: OwoColorize ;
10
10
use serde:: { Deserialize , Serialize } ;
11
11
use thiserror:: Error ;
12
- use tracing:: { debug, error, field:: display as as_display} ;
12
+ use tracing:: { debug, error, field:: display as as_display, info } ;
13
13
14
14
/// Bundles should have the following structure on the filesystem:
15
15
///
@@ -127,11 +127,11 @@ pub struct BundleMeta {
127
127
128
128
impl Display for Bundle {
129
129
fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
130
- writeln ! ( f, "BUNDLE INFO" ) ?;
131
- writeln ! ( f, "┏━━━━━━━━━━━" ) ?;
132
- writeln ! ( f, "┃ bundle: {self:?}" ) ?;
133
- writeln ! ( f, "┃ genesis: {:?}" , self . genesis_json( ) . into_os_string( ) ) ?;
134
- writeln ! ( f, "┃ versions:" ) ?;
130
+ // writeln!(f, "BUNDLE INFO")?;
131
+ // writeln!(f, "┏━━━━━━━━━━━")?;
132
+ // writeln!(f, "┃ bundle: {self:?}")?;
133
+ // writeln!(f, "┃ genesis: {:?}", self.genesis_json().into_os_string())?;
134
+ // writeln!(f, "┃ versions:")?;
135
135
136
136
let versions =
137
137
fs:: read_dir ( self . versions_path ( ) ) . expect ( "can't read contents of versions path" ) ;
@@ -195,6 +195,19 @@ impl Bundle {
195
195
}
196
196
}
197
197
198
+ pub fn log_bundle ( bundle : & Bundle ) {
199
+ let versions = fs:: read_dir ( bundle. versions_path ( ) )
200
+ . expect ( "can't read contents of versions path" )
201
+ . map ( |v| {
202
+ v. expect ( "can't read version in dir" )
203
+ . path ( )
204
+ . into_os_string ( )
205
+ } )
206
+ . collect :: < Vec < _ > > ( ) ;
207
+
208
+ info ! ( target: "unionvisor" , ?bundle, genesis=?bundle. genesis_json( ) . into_os_string( ) , ?versions, "running with bundle" ) ;
209
+ }
210
+
198
211
#[ derive( Debug , Error ) ]
199
212
pub enum NewBundleError {
200
213
#[ error( "cannot read bundle/meta.json" ) ]
0 commit comments