Skip to content

Commit

Permalink
0.4.5 - Added local time to log
Browse files Browse the repository at this point in the history
  • Loading branch information
ShayBox committed Jan 24, 2024
1 parent 02ff2cb commit 4e58d97
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 deletions.
15 changes: 12 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "vrc-log"
version = "0.4.4"
version = "0.4.5"
authors = ["Shayne Hartford <shaybox@shaybox.com>"]
edition = "2021"
description = "VRChat Local Cache Avatar ID Logger"
Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ use std::{
path::{Path, PathBuf},
};

use chrono::Local;
use colored::{Color, Colorize};
use crossbeam::channel::{Receiver, Sender};
use lazy_static::lazy_static;
use notify::{Config, Event, PollWatcher, RecursiveMode, Watcher};
use parking_lot::RwLock;
use regex::{Captures, Regex};
use chrono::Local;

pub mod config;
#[cfg(feature = "discord")]
Expand All @@ -19,9 +19,9 @@ pub mod provider;

pub type WatchResponse = (Sender<PathBuf>, Receiver<PathBuf>, PollWatcher);

#[must_use]
pub fn get_local_time() -> String {
let local_time = Local::now();
local_time.format("%Y-%m-%d %H:%M:%S").to_string()
Local::now().format("%Y-%m-%d %H:%M:%S").to_string()
}

/// # Errors
Expand Down
12 changes: 6 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#[cfg(feature = "title")]
use crossterm::{execute, terminal::SetTitle};
use vrc_log::{
box_db,
config::VRChat,
get_local_time,
provider::{prelude::*, Providers, Type}
box_db,
config::VRChat,
get_local_time,
provider::{prelude::*, Providers, Type},
};

fn main() -> anyhow::Result<()> {
#[cfg(feature = "title")]
execute!(std::io::stdout(), SetTitle("VRC-LOG"))?;

let config = VRChat::load()?;
#[cfg_attr(not(feature = "cache"), allow(unused_mut))]
let mut providers = Providers::from([
Expand Down Expand Up @@ -41,7 +41,7 @@ fn main() -> anyhow::Result<()> {
}

let local_time = get_local_time();

vrc_log::print_colorized(&avatar_id); // Submit the avatar to providers
for (provider_type, provider) in &providers {
if let Err(error) = provider.send_avatar_id(&avatar_id) {
Expand Down

0 comments on commit 4e58d97

Please sign in to comment.