Skip to content

Commit 84e9065

Browse files
JannisJannis Pohlmann
authored andcommitted
node: Print version information on startup
Resolves #591. Thanks to my friend @kinnison who wrote git-testament!
1 parent 6ec3157 commit 84e9065

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

Cargo.lock

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ edition = "2018"
77
clap = "2.31.2"
88
env_logger = "0.5.10"
99
futures = "0.1.21"
10+
git-testament = "0.1"
1011
graphql-parser = "0.2.1"
1112
http = "0.1"
1213
# We're using the latest ipfs-api for the HTTPS support that was merged in

node/src/main.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ extern crate url;
1919

2020
use clap::{App, Arg};
2121
use futures::sync::oneshot;
22+
use git_testament::{git_testament, render_testament};
2223
use ipfs_api::IpfsClient;
2324
use lazy_static::lazy_static;
2425
use std::env;
@@ -59,6 +60,8 @@ lazy_static! {
5960
.unwrap_or(50);
6061
}
6162

63+
git_testament!(TESTAMENT);
64+
6265
fn main() {
6366
let (shutdown_sender, shutdown_receiver) = oneshot::channel();
6467
// Register guarded panic logger which ensures logs flush on shutdown
@@ -236,6 +239,13 @@ fn async_main() -> impl Future<Item = (), Error = ()> + Send + 'static {
236239
// Set up logger
237240
let logger = logger(matches.is_present("debug"));
238241

242+
// Log version information
243+
info!(
244+
logger,
245+
"Graph Node version: {}",
246+
render_testament!(TESTAMENT)
247+
);
248+
239249
// Safe to unwrap because a value is required by CLI
240250
let postgres_url = matches.value_of("postgres-url").unwrap().to_string();
241251

0 commit comments

Comments
 (0)