Can I add a Processor to just one Monolog handler? - monolog

Can I add a Processor to just one Monolog handler? Or is there some other way I can alter a message that is only going out to one particular handler?
I want to add a text string to the end of $record['message']. I can do this now with a processor, but it affects all my handlers, which is no good for my situation.
Thanks.

Maybe this link can help you out:
https://github.com/Seldaek/monolog/blob/master/doc/01-usage.md#customizing-the-log-format
Also you can add a processor directly to the handler:
$stackifyHandler->pushProcessor(<callable>);

Related

AutoHotKey ControlGet

I have a script that is throwing and error when I issue a ControlGet.
OtPtVar := AfxWnd422
strMPP := Material Planning Profile
ControlFocus,%OtPtVar%,,%strMPP%
Control,Show,,%OtPtVar%,,%strMPP%
These all work but when it gets to the next line it throws an error:
ControlGet,sysList,List,,%OtptVar%,,%strMPP%
The control is a grid with five fields row number,Part,Description,Time,Lateness.
`ControlFocus,%OtPtVar%,,%strMPP%`
`Control,Show,,%OtPtVar%,,%strMPP%`
`ControlGet,sysList,List,,%OtPtVar%,,%strMPP%`
The error occurs on the last line.
Thank you.
After searching the AutoHotKey site I found to the following:
Those Afx window classes were custom classes distributed with early versions of MFC, before the "Common Controls" concept was introduced.
Many people have tried to "read" text from them but you CAN'T, not with messages anyway!
They're almost certainly owner-drawn - the text is not delivered by messages, it's "hand-drawn" into the window's DC
...
Messages are a dead-end I think - those who have pursued this problem must have already clocked up several hundreds of hours of monitoring message traffic between them!
So its not possible to get a hold of the control.
ControlGet's List subcommand can only handle standard listview controls, which usually have the class 'SysListView32'.
Did you try AccViewer just in case.
This link mentions textcapturex by Deskperience Software in case that helps.
"AfxWnd42s" Please Help - AutoIt General Help and Support - AutoIt Forums
https://www.autoitscript.com/forum/topic/49057-afxwnd42s-please-help/
There are theoretically process hacker methods,
but I'm not an expert on those, and wouldn't recommend such methods.
And yes, unfortunately when I really needed to, I used OCR once.
Potentially you can do OCR, recreate the text in the same font,
and check for an exact image match as a double-check.
Also, if possible, set the font to one where characters such as capital i and small L are unambiguous.

Can I return the tag and routine name?

I am working on a code "maintenance" idea where I would like to populate a global when routines are accessed and by who. I can pull the current routine name using $t(+0) or $ZNAME, but what about the current tag and/or line offset? Is there a way so I can put a standard line in the routines I want to track?
Rob, you can get these information from $STACK.
If you call your own tracking function, you get the calling stack info like this:
W $STACK($STACK(-1)-1,"PLACE")
zExecute+2^%Studio.General.1 +1
Take a look at the Caché ObjectScript Reference for $STACK for detailed description and examples.
Rob!
Maybe you just turn on Audit? It gathers logs for different users activities in InterSystems Caché database. See the documentation on Caché Audit.
Also, see this solution which will help you to examine analytics in DeepSee regarding Audit entries.
You can find the routine that's calling your label, by the following ClassMethod.
write ##class(%SYSTEM.Process).CallingRoutine()
As well as the database which is calling your label.
write ##class(%SYSTEM.Process).CallingDatabase()

Is it possible to use a control without putting it on a form in VB6?

I'm pretty sure about the answer to this, but I'm trying a variety of things to get a very stubborn project to work. One idea was to try to run code through a control without defining it on a form.
So, for example, my original code looked like this:
frmProcess.MyViewer.MaxPageSize = 100
frmProcess.MyViewer.ResetPages
frmProcess.MyViewer.AddPageToView "C:\TestPage1.txt"
I've changed it to:
Dim objViewer As MyViewer
objViewer.MaxPageSize = 100
objViewer.ResetPages
objViewer.AddPageToView "C:\TestPage1.txt"
I get an error window with "Run-time error '91': Object variable or With block variable not set".
But there doesn't seem to be a way to 'set' this control. Is this just impossible, or is there another way to do it that doesn't require a form?
EDIT: I ended up abandoning this entire path of activity, as an alternate solution was found that got around the problem I was having with this form freezing. I don't want to delete this question in case someone else comes along and can benefit from the answers, which are potentially useful.
Try this on a form.
Dim objViewer As MyViewer
Set objViewer = Controls.Add("MyViewer", "MyViewer1")
objViewer.MaxPageSize = 100
objViewer.ResetPages
objViewer.AddPageToView "C:\TestPage1.txt"
I've had similar situations in the past. If all else fails and you have to use a form you can do something crude like
1) Set the .Left property of the control to a negative number (like -10000) so the control doesn't appear on the form, the user can not see it
2) Make the entire form not visible..
ActiveX controls normally expect a number of services from their containers, for example persistence. They are also "packaged and marked" in ways that set the kinds of instantiation they support.
See Introduction to ActiveX Controls.
While it is perfectly possible for a control to be created in such a way as to make many of the available services optional, most controls are created from template code that requires a number of them. And most controls that are "visible at runtime" are going to require container services.
However that doesn't mean a control can't be designed to support containerless instantiation. A well known example of such a control is Microsoft Script Control 1.0 (MSScriptControl.ScriptControl) which can be used either way.

EntryCompletion: Message if no or too many matches

I want to use EntryCompletion from pygtk[1].
I could not find a way to tell the user if there are no or too many matches.
Adding an extra gtk.Label would be possible, but does not look very nice. I guess other developer who use EntryCompletion want to display a message like "no matches found" to their users...
[1] http://www.pygtk.org/docs/pygtk/class-gtkentrycompletion.html
There were too many things which were not available in EntryCompletion. I use a Label and an Entry now. I connect to the "changed" event and update the label.

Using barcode scanner to read barcode in forms 10g

I want to use barcode to read instead of using input from keyboard. I use Key Enter trigger and passing null against it but it did't fire. Any solution.....
I Googled for it and found this article. The pertinent line is
"In order to cause the key-next-item to execute you will need to ensure
the bar code reader sends a TAB key sequence at the end of each scan
so that the key-next-item trigger will fire."
I don't know whether that will solve your problem but the solution will probably be something along those lines: configuration of the reader.