File tree Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -169,8 +169,6 @@ lazy_static! {
169169 ) ;
170170}
171171
172- pub const LOG_FILE : & ' static str = "/var/log/quark/quark.log" ;
173-
174172pub fn InitSingleton ( ) {
175173 self :: qlib:: InitSingleton ( ) ;
176174}
Original file line number Diff line number Diff line change @@ -43,9 +43,14 @@ pub fn SetSyncPrint(syncPrint: bool) {
4343 LOG . SetSyncPrint ( syncPrint) ;
4444}
4545
46- pub const LOG_FILE_DEFAULT : & str = "/var/log/quark/quark.log" ;
47- pub const RAWLOG_FILE_DEFAULT : & str = "/var/log/quark/raw.log" ;
48- pub const LOG_FILE_FORMAT : & str = "/var/log/quark/{}.log" ;
46+
47+ pub const LOG_DIR : & str = match option_env ! ( "QLOG_DIR" ) {
48+ Some ( s) => s,
49+ None => "/var/log/quark"
50+ } ;
51+ pub const LOG_FILE_DEFAULT : & str = concatcp ! ( LOG_DIR , "/quark.log" ) ;
52+ pub const RAWLOG_FILE_DEFAULT : & str = concatcp ! ( LOG_DIR , "/raw.log" ) ;
53+ pub const LOG_FILE_FORMAT : & str = concatcp ! ( LOG_DIR , "/{}.log" ) ;
4954pub const TIME_FORMAT : & str = "%H:%M:%S%.3f" ;
5055
5156pub const MEMORY_LEAK_LOG : bool = false ;
Original file line number Diff line number Diff line change @@ -166,13 +166,15 @@ impl VirtualMachine {
166166 ) ;
167167 }
168168
169+ pub const QUARK_BIN_DIR : & ' static str = match option_env ! ( "QBIN_DIR" ) {
170+ Some ( s) => s,
171+ None => "/usr/local/bin"
172+ } ;
173+ pub const VDSO_PATH : & ' static str = concatcp ! ( VirtualMachine :: QUARK_BIN_DIR , "/vdso.so" ) ;
169174 #[ cfg( debug_assertions) ]
170- pub const KERNEL_IMAGE : & ' static str = "/usr/local/bin/qkernel_d.bin" ;
171-
175+ pub const KERNEL_IMAGE : & ' static str = concatcp ! ( VirtualMachine :: QUARK_BIN_DIR , "/qkernel_d.bin" ) ;
172176 #[ cfg( not( debug_assertions) ) ]
173- pub const KERNEL_IMAGE : & ' static str = "/usr/local/bin/qkernel.bin" ;
174-
175- pub const VDSO_PATH : & ' static str = "/usr/local/bin/vdso.so" ;
177+ pub const KERNEL_IMAGE : & ' static str = concatcp ! ( VirtualMachine :: QUARK_BIN_DIR , "/qkernel.bin" ) ;
176178
177179 pub fn InitShareSpace (
178180 cpuCount : usize ,
You can’t perform that action at this time.
0 commit comments