mirror of
https://github.com/bitwarden/browser
synced 2025-12-20 10:13:31 +00:00
This reverts commit 5386b58f23.
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "napi build --platform --js false",
|
"build": "node scripts/build.js",
|
||||||
"test": "cargo test"
|
"test": "cargo test"
|
||||||
},
|
},
|
||||||
"author": "",
|
"author": "",
|
||||||
|
|||||||
14
apps/desktop/desktop_native/napi/scripts/build.js
Normal file
14
apps/desktop/desktop_native/napi/scripts/build.js
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||||
|
const { execSync } = require('child_process');
|
||||||
|
|
||||||
|
const args = process.argv.slice(2);
|
||||||
|
const isRelease = args.includes('--release');
|
||||||
|
|
||||||
|
if (isRelease) {
|
||||||
|
console.log('Building release mode.');
|
||||||
|
} else {
|
||||||
|
console.log('Building debug mode.');
|
||||||
|
process.env.RUST_LOG = 'debug';
|
||||||
|
}
|
||||||
|
|
||||||
|
execSync(`napi build --platform --js false ${isRelease ? '--release' : ''}`, { stdio: 'inherit', env: process.env });
|
||||||
@@ -961,7 +961,7 @@ pub mod logging {
|
|||||||
};
|
};
|
||||||
use tracing::Level;
|
use tracing::Level;
|
||||||
use tracing_subscriber::{
|
use tracing_subscriber::{
|
||||||
filter::{EnvFilter, LevelFilter},
|
filter::EnvFilter,
|
||||||
fmt::format::{DefaultVisitor, Writer},
|
fmt::format::{DefaultVisitor, Writer},
|
||||||
layer::SubscriberExt,
|
layer::SubscriberExt,
|
||||||
util::SubscriberInitExt,
|
util::SubscriberInitExt,
|
||||||
@@ -1049,9 +1049,17 @@ pub mod logging {
|
|||||||
pub fn init_napi_log(js_log_fn: ThreadsafeFunction<(LogLevel, String), CalleeHandled>) {
|
pub fn init_napi_log(js_log_fn: ThreadsafeFunction<(LogLevel, String), CalleeHandled>) {
|
||||||
let _ = JS_LOGGER.0.set(js_log_fn);
|
let _ = JS_LOGGER.0.set(js_log_fn);
|
||||||
|
|
||||||
|
// the log level hierarchy is determined by:
|
||||||
|
// - if RUST_LOG is detected at runtime
|
||||||
|
// - if RUST_LOG is provided at compile time
|
||||||
|
// - default to INFO
|
||||||
let filter = EnvFilter::builder()
|
let filter = EnvFilter::builder()
|
||||||
// set the default log level to INFO.
|
.with_default_directive(
|
||||||
.with_default_directive(LevelFilter::INFO.into())
|
option_env!("RUST_LOG")
|
||||||
|
.unwrap_or("info")
|
||||||
|
.parse()
|
||||||
|
.expect("should provide valid log level at compile time."),
|
||||||
|
)
|
||||||
// parse directives from the RUST_LOG environment variable,
|
// parse directives from the RUST_LOG environment variable,
|
||||||
// overriding the default directive for matching targets.
|
// overriding the default directive for matching targets.
|
||||||
.from_env_lossy();
|
.from_env_lossy();
|
||||||
|
|||||||
Reference in New Issue
Block a user