Fork of daniellemaywood.uk/gleam — Wasm codegen work
2

Configure Feed

Select the types of activity you want to include in your feed.

gleam / compiler-core / src / build / telemetry.rs
1.1 kB 33 lines
1use std::{ 2 fmt::Debug, 3 time::{Duration, Instant}, 4}; 5 6use crate::Warning; 7 8pub trait Telemetry: Debug { 9 fn waiting_for_build_directory_lock(&self); 10 fn running(&self, name: &str); 11 fn resolving_package_versions(&self); 12 fn downloading_package(&self, name: &str); 13 fn packages_downloaded(&self, start: Instant, count: usize); 14 fn compiled_package(&self, duration: Duration); 15 fn compiling_package(&self, name: &str); 16 fn checked_package(&self, duration: Duration); 17 fn checking_package(&self, name: &str); 18} 19 20#[derive(Debug, Clone, Copy)] 21pub struct NullTelemetry; 22 23impl Telemetry for NullTelemetry { 24 fn waiting_for_build_directory_lock(&self) {} 25 fn running(&self, name: &str) {} 26 fn resolving_package_versions(&self) {} 27 fn downloading_package(&self, _name: &str) {} 28 fn compiled_package(&self, _duration: Duration) {} 29 fn compiling_package(&self, _name: &str) {} 30 fn checked_package(&self, _duration: Duration) {} 31 fn checking_package(&self, _name: &str) {} 32 fn packages_downloaded(&self, _start: Instant, _count: usize) {} 33}