mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
log: add log.use_stdout()
, use it to silence the transition note for the most commonly used V tools/examples (#23642)
This commit is contained in:
parent
23c3af8b4d
commit
319eb83525
12 changed files with 24 additions and 7 deletions
|
@ -41,6 +41,7 @@ fn lexec(cmd string) string {
|
|||
|
||||
fn main() {
|
||||
// ensure all log messages will be visible to the observers, even if the program panics
|
||||
log.use_stdout()
|
||||
log.set_always_flush(true)
|
||||
|
||||
total_sw := time.new_stopwatch()
|
||||
|
|
|
@ -97,6 +97,7 @@ struct FlagOptions {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
log.use_stdout()
|
||||
mut fp := flag.new_flag_parser(os.args.clone())
|
||||
fp.application(app_name)
|
||||
fp.version(app_version)
|
||||
|
|
|
@ -148,6 +148,7 @@ fn normalize_path(path string) string {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
log.use_stdout()
|
||||
mut ctx := Context{}
|
||||
ctx.working_folder = normalize_path(os.real_path(os.getwd()))
|
||||
mut fp := flag.new_flag_parser(os.args#[1..])
|
||||
|
|
|
@ -23,9 +23,7 @@ mut:
|
|||
const vexe = os.real_path(os.getenv_opt('VEXE') or { @VEXE })
|
||||
|
||||
fn main() {
|
||||
mut l := log.ThreadSafeLog{}
|
||||
l.set_output_stream(os.stdout())
|
||||
log.set_logger(l)
|
||||
log.use_stdout()
|
||||
mut ctx := Context{}
|
||||
mut fp := flag.new_flag_parser(os.args#[1..])
|
||||
fp.application(os.file_name(os.executable()))
|
||||
|
|
|
@ -22,6 +22,7 @@ fn run(cmd string) os.Result {
|
|||
}
|
||||
|
||||
fn test_retry() {
|
||||
log.use_stdout()
|
||||
log.warn('start...')
|
||||
defer {
|
||||
log.warn('... done')
|
||||
|
|
|
@ -4,6 +4,7 @@ import log
|
|||
const should_clean = os.args.contains('-c')
|
||||
|
||||
fn main() {
|
||||
log.use_stdout()
|
||||
mut files := []string{}
|
||||
args := os.args#[2..].filter(it != '-c')
|
||||
for a in args {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue