Skip to content

Commit

Permalink
add env_logger initialization and update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
mschuchard committed Apr 10, 2024
1 parent 512c46c commit 9ad50be
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
octocrab = "0.34"
octocrab = "0.38"
concourse-resource = "0.3"
tokio = { version = "1.36", features = ["rt-multi-thread", "macros"] }
tokio = { version = "1.0", features = ["rt-multi-thread", "macros"] }
serde = "1.0"
serde_json = "1.0"
log = "0.4"
env_logger = "0.11"

[profile.release]
opt-level = 's' # Optimize for size
Expand Down
10 changes: 10 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use concourse_resource::*;
use log;
use env_logger;

mod concourse;
mod github_issue;
Expand All @@ -22,6 +23,9 @@ impl concourse_resource::Resource for GithubIssue {
source: Option<Self::Source>,
_version: Option<Self::Version>,
) -> Vec<Self::Version> {
// init logger
_ = env_logger::try_init();

// validate and unwrap source
let source = match source {
Some(source) => source,
Expand Down Expand Up @@ -84,6 +88,9 @@ impl concourse_resource::Resource for GithubIssue {
concourse_resource::InOutput<Self::Version, Self::InMetadata>,
Box<dyn std::error::Error>,
> {
// init logger
_ = env_logger::try_init();

log::info!("reminder: the in step is only to be used for an efficient check step with minimal overhead");
Ok(concourse_resource::InOutput {
version: concourse::Version::new(String::from("Open")),
Expand All @@ -98,6 +105,9 @@ impl concourse_resource::Resource for GithubIssue {
params: Option<Self::OutParams>,
input_path: &str,
) -> concourse_resource::OutOutput<Self::Version, Self::OutMetadata> {
// init logger
_ = env_logger::try_init();

// validate source and params
let source = match source {
Some(source) => source,
Expand Down

0 comments on commit 9ad50be

Please sign in to comment.