[ + jba ] On Thu, Mar 16, 2023 at 8:56 AM Chandra S. Rangavajjula (Nokia) <chandra.s.rangavajj...@nokia.com> wrote: > > Hi, > I am using glog in my application development. With the latest tag > (https://github.com/golang/glog/releases/tag/v1.1.0), there started a new > panic error with -vmodule. This issue was not there in older version. > > ######################################################################################################################## > Error:- > ######################################################################################################################## > $./tst --help > usage: example -stderrthreshold=[INFO|WARNING|FATAL] -log_dir=[string] > -alsologtostderr > log to standard error as well as files > -log_backtrace_at value > when logging hits line file:N, emit a stack trace > -log_dir string > If non-empty, write log files in this directory > -log_link string > If non-empty, add symbolic links in this directory to the log files > -logbuflevel int > Buffer log messages logged at this level or lower (-1 means don't > buffer; 0 means buffer INFO only; ...). Has limited applicability on non-prod > platforms. > -logtostderr > log to standard error instead of files > -stderrthreshold value > logs at or above this threshold go to stderr (default 2) > -v value > log level for V logs > -vmodule value > comma-separated list of pattern=N settings for file-filtered logging > > panic calling String method on zero glog.vModuleFlag for flag vmodule: > runtime error: invalid memory address or nil pointer dereference > > ######################################################################################################################## > Example code:- > ######################################################################################################################## > package main > > import ( > "github.com/golang/glog" > "os" > "flag" > "fmt" > ) > > func usage() { > fmt.Fprintf(os.Stderr, "usage: example > -stderrthreshold=[INFO|WARNING|FATAL] -log_dir=[string]\n", ) > flag.PrintDefaults() > os.Exit(2) > } > > func init() { > flag.Usage = usage > // NOTE: This next line is key you have to call flag.Parse() for the > command line > // options or "flags" that are defined in the glog module to be picked > up. > flag.Parse() > } > > func main() { > number_of_lines := 100000 > for i := 0; i < number_of_lines; i++ { > glog.V(2).Infof("LINE: %d", i) > message := fmt.Sprintf("TEST LINE: %d", i) > glog.Error(message) > } > glog.Flush() > } > ######################################################################################################################## > > Regards, > Chandra R > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/AS4PR07MB875652B4C33A66DF22D15C5BC3BC9%40AS4PR07MB8756.eurprd07.prod.outlook.com.
-- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcXXuFg24BCDAtSRLd2XjSqVJOHtMfbdqMH-EryF0mK7iA%40mail.gmail.com.