PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, August 16, 2022

[FIXED] How to get Google-glog output in console?

 August 16, 2022     console, linux, logging, output     No comments   

Issue

I am using a framework for convolutional neural networks called caffe and its output in console is provided by Google-glog. However when I try to save the output to a file using the following commands:

sh train_imagenet.sh | tee output.txt

or

sh train_imagenet.sh > output.txt

And I get a void file and the output does not save to the file. So I want to know how to retrieve this output. Thanks in advance.


Solution

I am using Caffe too. You can try

sh train_imagenet.sh 2>&1 | tee output.txt

You may also add option -i to tee to ignore Ctrl-C (which passes the SIGINT signal to train_imagenet.sh instead of tee)

sh train_imagenet.sh 2>&1 | tee -i output.txt

BTW, glog will write log messages to log files by default. The log files provide better severity level seperation than stdout and stderr.

Unless otherwise specified, glog writes to the filename "/tmp/<program name>.<hostname>.<user name>.log.<severity level>.<date>.<time>.<pid>" (e.g., "/tmp/hello_world.example.com.hamaji.log.INFO.20080709-222411.10474").

By default, glog copies the log messages of severity level ERROR or FATAL to standard error (stderr) in addition to log files.

Location of the log file can be set by environment variable GLOG_log_dir or by command line flag log_dir (if gflags is installed). See https://godoc.org/github.com/golang/glog for more detail.



Answered By - phil
Answer Checked By - Robin (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing