Module-wise verbose logging in Google glog - c++

I'm using Google glog for logging. I have a file in a directory with path dir/file.cc.
I want to enable verbose logging level 5 just in this file. So I export GLOG_vmodule="file=5" into the environment and then run the program. But glog still doesn't log the VLOG(5) messages in this file. Is there a problem with the way I'm setting vmodule? Can anyone give me an example of how this should be done?

As specified here in the glog documentation:
Verbose logging can be controlled from the command line on a per-module basis:
--vmodule=mapreduce=2,file=1,gfs*=3 --v=0 will:
a. Print VLOG(2) and lower messages from mapreduce.{h,cc}
b. Print VLOG(1) and lower messages from file.{h,cc}
c. Print VLOG(3) and lower messages from files prefixed with "gfs"
d. Print VLOG(0) and lower messages from elsewhere

Related

Batch jcl error for cics web services using cics web service assistant tool

I am facing issue while submitting below job, can someone please suggest?
Error:
IEF344I KA7LS2W2 INPUT STEP1 SYSUT2 - ALLOCATION FAILED DUE TO DATA FACILITY SYSTEM ERROR
IGD17501I ATTEMPT TO OPEN A UNIX FILE FAILED,
RETURN CODE IS (00000081) REASON CODE IS (0594003D)
FILENAME IS (/ka7a/KA7A.in)
JCL:
//KA7LS2W2 JOB (51,168),'$ACCEPT',CLASS=1,
// MSGCLASS=X,MSGLEVEL=(1,0),NOTIFY=&SYSUID,REGION=0M
// EXPORT SYMLIST=*
// JCLLIB ORDER=SYS2.CI55.SDFHINST
//STEP1 EXEC DFHLS2WS,
// JAVADIR='java/J7.0_64',PATHPREF='',TMPDIR='/ka7a',
// USSDIR='',TMPFILE=&QT.&SYSUID.&QT
//INPUT.SYSUT1 DD *
PDSLIB=//DJPN.KA7A.POC
LANG=COBOL
PGMINT=CHANNEL
PGMNAME=KZHFEN1C
REQMEM=PAYIN
RESPMEM=PAYOUT
MAPPING-LEVEL=2.2
LOGFILE=/home/websrvices/wsbind/payws.log `enter code here`
WSBIND=/home/webservices/wsbind/payws.wsbind
WSDL=/home/webservices/wsdl/payws.wsdl
/*
Based on the Return Code 81 / Reason Code 0594003D the pathname can't be resolved.
the message IGD17501I explains the error. You'll find more information looking up the Reason Code 0594003D.
You can use BPXMTEXT to lookup more detail on the Reason Code.
Executing this command in USS you'll see:
$ bpxmtext 0594003D
BPXFVLKP 05/14/20
JRDirNotFound: A directory in the pathname was not found
Action: One of the directories specified was not found. Verify that the name
specified is spelled correctly.
Per #phunsoft adding that the same command can be executed in TSO and is not case sensitive like USS.
I'd suspect that /ka7a doesn't exist. Is it a case issue? Or perhaps you meant /u/ka7a/ or `/home/ka7a' ?

dragonfly+dragon naturally speaking not working

I've got Dragon Naturally Speaking 14, dragonfly, the latest natlink (4.1 or something), pywin32, python 2.7, and wxpython installed
I've got a python file with this in it in my "user configuration directory" set up by natlink
I get the natlink popup message when Dragon Naturally Speaking starts, telling me that it's working. I reset DNS 14 to ensure my "macro" (dosomething.py) is loaded.
this is the code in my dosomething.py
from dragonfly import Grammar, CompoundRule
# Voice command rule combining spoken form and recognition processing.
class ExampleRule(CompoundRule):
spec = "do something computer" # Spoken form of command.
def _process_recognition(self, node, extras): # Callback when command is spoken.
print "Voice command spoken."
# Create a grammar which contains and loads the command rule.
grammar = Grammar("example grammar") # Create a grammar to contain the command rule.
grammar.add_rule(ExampleRule()) # Add the command rule to the grammar.
grammar.load() # Load the grammar.
while True:
pythoncom.PumpWaitingMessages()
sleep(.1)
however, when I start up & activate DNS and say "do something computer" with dictation & command mode, or just command mode, the transcription box pops up, how can I tell if it's working or not? I don't think it is. What is supposed to happen? I'm new to python, I fired up the interpreter in the cmd window and no prompt like "Voice command spoken." is ever generated when I say the voice command. Is that what's supposed to happen?
There are two ways to load up Dragonfly grammars: through Natlink, and through Windows Speech Recognition. WSR requires you to put in that while loop with pythoncom.PumpWaitingMessages(), but that won't work with Natlink. You should comment it out.
If you set this up correctly, you won't see "Voice command spoken." in any cmd prompt -- you will see it in the Natlink window.

log4cpp and odd console output

I am trying to use log4cpp on my project. But everytime I try to write a log message in addition to the log message going to the log file I also get this message to the console window.
/var/log/ngis/mixer.log.3
Here is the copy of the appropriate section of my log4cpp.properties file.
# This is for the rolling file Appender, this will not send log info
# to the syslog.
log4cpp.rootCategory=INFO, rootAppender
log4cpp.appender.rootAppender=RollingFileAppender
log4cpp.appender.rootAppender.fileName=/var/log/ngis/mixer.log
log4cpp.appender.rootAppender.maxFileSize=10MB
log4cpp.appender.rootAppender.maxBackupIndex=3
log4cpp.appender.rootAppender.BufferedIO=true
log4cpp.appender.rootAppender.BufferSize=100000
log4cpp.appender.rootAppender.layout=PatternLayout
log4cpp.appender.rootAppender.layout.ConversionPattern=%d[%p %c] %m%n
The data is going to the log file. I have tried creating a file called /var/log/ngis/mixer.log.3 but that does not help.
if I change the .maxBackupIndex=3 to .maxBackupIndex=2 then the message changes to:
/var/log/ngis/mixer.log.2

how to print logs into only one file by google glog

I'm now using google glog. When I'm debugging the program, every time the process restart, a new log file generated, identified by the new pid as filename's sufix, like this
ied_config.20131220-142934.4524
ied_config.20131220-171227.3948
ied_config.20131225-170117.7032
ied_config.20131225-170131.5200
ied_config.20131225-171450.7820
ied_config.20131225-172336.4116
ied_config.20131225-172924.6120
ied_config.20131225-173000.2980
ied_config.20131225-173037.1960
ied_config.20131225-173144.7304
ied_config.20131226-095843.1012
smv_client.20131219-082120.7184
smv_client.20131219-162339.5508
smv_client.20131219-163055.6156
smv_client.20131219-163155.4892
smv_client.20131219-163206.5576
smv_client.20131219-163216.6340
smv_client.20131219-163236.6952
smv_client.20131219-163307.7940
smv_client.20131219-163317.4920
smv_client.20131219-163347.6556
smv_client.20131219-163408.5124
smv_client.20131219-163428.2644
smv_client.20131219-163448.6040
smv_client.20131219-163529.6948
smv_client.20131219-163539.1592
smv_client.20131219-163549.3776
smv_client.20131219-172949.5412
smv_client.20131219-173000.4180
smv_client.20131219-173010.7432
smv_client.20131220-170628.636
smv_client.20131220-170930.3904
smv_client.20131226-095841.1296
I want to join these log just into one file for each program, I can't file the configuration for the glog ,any helps?
If you want to change the name of log files, you may need to call SetLogDestination():
google::SetLogDestination(google::INFO, "/var/tmp/another_destination.INFO");
From release 0.5 on May 8, 2021
Allow a log file to be simply named "foobar.log" with no appended
string #124
google::SetLogDestination(google::INFO, "/var/tmp/another_destination.INFO");
FLAGS_timestamp_in_logfile_name = false;

How to get my program name in GDB when writting a "define" script?

I found it's very annoying to get the program name when defining a GDB script. I can't find any corresponding "info" command, and we can't use argv[0] either, because of multi-process/thread and frame-choosing.
So, what should I do?
If you are using a recent gdb (7 and above) you can play around with the Python support which is quite extensive (and probably where you want to go when defining gdb-scripts in general). I'm no expert at it but for a test-program /tmp/xyz I could use:
(gdb) python print gdb.current_progspace().filename
/tmp/xyz
See http://sourceware.org/gdb/current/onlinedocs/gdb/Python.html for more info on the Python support.
In "normal" gdb you could get the process name with "info proc" and "info target", but I guess you wanted it not just printed but being able to use it further in scripts? Don't know how to get the value out of the python runtime into a gdb variable other than the extremely ugly "using log files and sourcing it and hope for the best". This is how this could be done:
define set-program-name
set logging file tmp.gdb
set logging overwrite on
set logging redirect on
set logging on
python print "set $programname = \"%s\"" % gdb.current_progspace().filename
set logging off
set logging redirect off
set logging overwrite off
source tmp.gdb
end
and in your own function doing:
define your-own-func
set-program-name
printf "The program name is %s\n", $programname
end
I would suggest "going all in" on the python support, and scrap gdb-scripting. I believe it is worth the effort.