Skip to content

Commit

Permalink
Revert making logs public since canister isn't its own controller (#7092
Browse files Browse the repository at this point in the history
)
  • Loading branch information
hpeebles authored Dec 19, 2024
1 parent 1267b3e commit 0909ae0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ fn post_upgrade(args: Args) {
let (mut data, errors, logs, traces): (Data, Vec<LogEntry>, Vec<LogEntry>, Vec<LogEntry>) =
msgpack::deserialize(reader).unwrap();

canister_logger::init_with_logs(data.test_mode, errors, logs, traces);

data.events.fix_role_changed_events();

let env = init_env(data.rng_seed);
Expand All @@ -30,8 +32,6 @@ fn post_upgrade(args: Args) {
channel.chat.events.remove_spurious_video_call_in_progress(now);
}

canister_logger::init_with_logs(data.test_mode, errors, logs, traces);

init_state(env, data, args.wasm_version);

let completed_imports = read_state(|state| state.data.groups_being_imported.completed_imports());
Expand Down
16 changes: 0 additions & 16 deletions backend/canisters/user_index/impl/src/lifecycle/post_upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ use crate::memory::get_upgrades_memory;
use crate::Data;
use canister_logger::LogEntry;
use canister_tracing_macros::trace;
use ic_cdk::api::management_canister::main::{CanisterSettings, LogVisibility, UpdateSettingsArgument};
use ic_cdk::post_upgrade;
use stable_memory::get_reader;
use std::time::Duration;
use tracing::info;
use user_index_canister::post_upgrade::Args;
use utils::cycles::init_cycles_dispenser_client;
Expand All @@ -28,18 +26,4 @@ fn post_upgrade(args: Args) {
init_state(env, data, args.wasm_version);

info!(version = %args.wasm_version, "Post-upgrade complete");

ic_cdk_timers::set_timer(Duration::ZERO, || ic_cdk::spawn(make_logs_public()));
}

async fn make_logs_public() {
ic_cdk::api::management_canister::main::update_settings(UpdateSettingsArgument {
canister_id: ic_cdk::id(),
settings: CanisterSettings {
log_visibility: Some(LogVisibility::Public),
..Default::default()
},
})
.await
.unwrap()
}

0 comments on commit 0909ae0

Please sign in to comment.