mirror of
https://github.com/bitwarden/browser
synced 2026-02-03 10:13:31 +00:00
Explicitly initialize logging in macOS autofill extension
This commit is contained in:
@@ -198,22 +198,6 @@ impl AutofillProviderClient {
|
||||
///
|
||||
/// See documentation at the top-level of [this struct][AutofillProviderClient] for usage information.
|
||||
pub fn connect() -> Self {
|
||||
#[cfg(target_os = "macos")]
|
||||
INIT.call_once(|| {
|
||||
let filter = EnvFilter::builder()
|
||||
// Everything logs at `INFO`
|
||||
.with_default_directive(LevelFilter::INFO.into())
|
||||
.from_env_lossy();
|
||||
|
||||
tracing_subscriber::registry()
|
||||
.with(filter)
|
||||
.with(tracing_oslog::OsLogger::new(
|
||||
"com.bitwarden.desktop.autofill-extension",
|
||||
"default",
|
||||
))
|
||||
.init();
|
||||
});
|
||||
|
||||
tracing::trace!("Autofill provider attempting to connect to Electron IPC...");
|
||||
|
||||
let (from_server_send, mut from_server_recv) = tokio::sync::mpsc::channel(32);
|
||||
@@ -336,6 +320,25 @@ impl AutofillProviderClient {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
#[uniffi::export]
|
||||
pub fn initialize_logging() {
|
||||
INIT.call_once(|| {
|
||||
let filter = EnvFilter::builder()
|
||||
// Everything logs at `INFO`
|
||||
.with_default_directive(LevelFilter::INFO.into())
|
||||
.from_env_lossy();
|
||||
|
||||
tracing_subscriber::registry()
|
||||
.with(filter)
|
||||
.with(tracing_oslog::OsLogger::new(
|
||||
"com.bitwarden.desktop.autofill-extension",
|
||||
"default",
|
||||
))
|
||||
.init();
|
||||
});
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
#[serde(tag = "command", rename_all = "camelCase")]
|
||||
enum CommandMessage {
|
||||
|
||||
@@ -30,6 +30,7 @@ class CredentialProviderViewController: ASCredentialProviderViewController {
|
||||
return client
|
||||
}
|
||||
|
||||
initializeLogging()
|
||||
let logger = Logger(subsystem: "com.bitwarden.desktop.autofill-extension", category: "credential-provider")
|
||||
|
||||
// Check if the Electron app is running
|
||||
|
||||
Reference in New Issue
Block a user