appengine console for local development logs are an eye sore red(like a bunch of errors!!!) by default. How can I change that to standard black for normal log and red for error? If I right click on the console and go to preference, the setting is correct : standard black and error red.
The output from the DevAppServer is sent to stderr, so you need to change the error colour to black.
Note after one year : I do not use 'java.util.logging' anymore. I had have got a strange bug where my thread stopped in the method 'log()'. It was probably a dead lock. I've swith to 'Log4j'.
In order to have the errors logged in red and the infos in black in the eclipse console, you can create your own ConsoleHandler:
public class MyConsoleHandler extends StreamHandler {
private java.util.logging.Formatter formatter = new SimpleFormatter();
public void publish(LogRecord record){
if(record.getLevel().intValue() < Level.WARNING.intValue())
System.out.println(formatter.formatMessage(record));
else
System.err.println(formatter.format(record));
}
}
and use plug it with:
java.util.logging.LogManager.getLogManager().reset();
java.util.logging.Logger.getLogger("").addHandler(new MyConsoleHandler())
Related
i just started learning Haxe today and i got a couple of problems with my VSCode.
There are 3 "Errors" in total, to be exact 2 errors and 1 info, but the info seems kind of wrong and i would like to know how to get rid of it aswell.
Before i go into more detail, some info that might be relevant:
I created my project using the "Haxe: Initialize Project" from the Haxe VSCode extension
I changed nothing in the build.hxml file
If i run my code via VSCode (Ctrl-Shift-B) i get an error
If i run it on a normal CMD with "haxe build.hxml" it works totally fine, no errors at all
The Code:
class Main {
static function main() {
trace("Hello, World!");
var t:String = Sys.stdin().readLine().toString();
trace(t);
}
}
The build.hxml file:
-cp src
-D analyzer-optimize
-main Main
--interp
The first error i get:
It seems that this error is not even in my own file, how can this be?
The Sys.stdin().readLine() seems to have something to do with it, since this error came the moment i added this line.
Uncaught exception Not implemented in haxe.io.input.readByte at haxe/io/Input.hx tasks [180. 1]
Screenshot from VSCode
The second error i get:
Once again it seems to have something to do with Sys.stdin().readline() this time this exact part of my code is red underlined and the error message is pointing at this exact line.
Called from here tasks [4, 18]
Screenshot from VSCode (Error)
Screenshot from VSCode (red underline)
The (kind of) error / Info i get:
This is the most weird one imho..
Its a blue "~" i get at the beginning of my trace("Hello, World!"); line.
Screenshot from the weird Blue Symbol
Screenshot from the VSCode "Problem" regarding this line
Thanks in advance!
I looked through the internet the whole day hoping to find something to get this things solved on my own, but since its my first time ever using Haxe and i was not able to find something even similar to this i hope some of you 5heads out there can help me with this. :)
https://i.stack.imgur.com/4RWsz.png
Above is what I see in NeoVim 0.4.4 (on Ubuntu) when I get a type error using coc.nvim and the Haskell Language Server. My configuration for all background and theme related things are:
syntax on
set t_Co=256
" Enable italics
set t_ZH=^[[3m
set t_ZR=^[[23m
" Initialize colorscheme
highlight Normal ctermbg=NONE
let g:lightline = {
\ 'colorscheme': 'nord',
\ }
set noshowmode " nvim no longer shows the mode we're in; that's shown by lightline
let g:nord_cursor_line_number_background = 1
let g:nord_italic = 1
let g:nord_italic_comments = 1
let g:nord_underline = 1
let g:nord_bold = 1
"let g:gruvbox_itaic = 1
colorscheme nord
hi! clear Conceal
I do not know what could be causing the error, and as far as I remember, this was never an issue until recently. I have not tweaked my config in the time that has lapsed before this error appeared and after. I am also using tmux as well, but the error persists whether I open NeoVim in tmux or not. How should I go about solving this problem, and are there any places I could look to learn more about resolving such issues like this in the future?
I had the same problem and solved it with highlight CocErrorFloat ctermfg=White guifg=#ffffff which shows error message text in white color. You can change text color to whatever you like which you should specify in ctermfg=Color guifg=colorCode
I'm trying to set my Eclipse RCP Application's initial size in the suggested way but it doesnt affect the actual size of the window. It doesn't matter what I set the size to the window always appears as fixed with 1020*765 dimensions.
See attached picture (I blanked out some sensitive info). I set the point to 600*400 yet the window appears with the same dimensions. So far no values entered affected the actual size.
I clear the workspace each time and even use -clearPersistedState
Any help would be appreciated
If you are running Eclipse 4.3 or 4.2 this is Eclipse bug 418615 the fix is scheduled for 4.3.2
By Greg's suggestion I looked for a different way and I could manage by using this code. Seems that under 4.3.1 the configurer's initialSize property never gets used but set to 1024*768 by default. This sets the Application window to the display's size:
#Override
public void postWindowOpen() {
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().setBounds(getDisplaySize());
}
private Rectangle getDisplaySize() {
try {
Display display = Display.getCurrent();
Monitor monitor = display.getPrimaryMonitor();
Rectangle rect = monitor.getBounds();
return rect;
}
catch ( Throwable ignore ) {
return new Rectangle(0,0,1024,768);
}
}
Also for a maximized state you can use:
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().setMaximized(true);
I am trying to call an existing VFP 6 application using Jacob which is a COM bridge for Java.
val vfp = new Application(new ActiveXComponent("VisualFoxPro.Application").getProperty("Application").toDispatch())
vfp.setVisible(false)
try {
vfp.doCmd("do my.exe with myconfig.txt")
} catch {
case t: Throwable => t.printStackTrace
} finally {
vfp.doCmd("close data")
vfp.doCmd("clear all")
vfp.doCmd("clear")
vfp.quit
vfp.safeRelease
}
When there are no error conditions this code executes well and generates the expected .dbfs. The problem is that when an error occurs (.dbf not found, file in use by another user, etc) a GUI window pops up and stops execution of the program until I use the mouse to cancel it. I want this program to run on a server with no user interaction so this won't work.
How can I gracefully handle the errors preferably without making a change to the VFP 6 program?
Since you have the source code for VFP6, I would suggest looking into
SYS(2335,0)
Sys 2335 is used to identify if the program is running in an "unattended" mode, any such popup dialog boxes will throw an error and prevent an actual "hit" ok/cancel/whatever button to continue. This includes popup window prompting user to pick a table.
I'm not positive of when it was made available as I had limited use of it. Like you, when dealing with a COM server under IIS and obviously nobody there to respond.
Start JVM in headless mode, catch HeadlessException or something. Or, write a Java program that will execute your GUI program using Runtime, and restart in a case of parsed errors in console.
I am invoking a compiler command but the compiler messages are not getting displayed in the Eclipse Console View consistently.
I have my launch() method implemented the same way as first code block of
this question; I have the command-line string setup which I use to call DebugPlugin.exec() method. However, unlike the the author of the question above, my output Eclipse console is very inconsistent. T
There is no activity in the console when I invoke the command and the console continues to display the "No console to display at this time." But after invoking the command numerous time and activating different consoles from the drop-down menu, the console occasionally does become active and message is displayed.
I am confused with how the eclipse is behaving and not sure how to resolve this issue. Any comment and/or recommendation would be appreciated.
Thanks!!
--
EDIT
To add some more info, running the external process using External Tools works fine. I add the compiler process c:\path\myprocess.exe in Locations field and the file to compile in the Arguments field within the External Tools Configuration window. When I run it, all the output is displayed fine. It just won't display when I run it programmatically through LaunchConfigurationDelegate class.
Maybe try bringing the console to front programmatically see if it helps:
* Bring the console to front.
*/
public static void showConsole() {
Display.getDefault().asyncExec(new Runnable() {
#Override
public void run() {
IWorkbenchWindow window = CUIPlugin.getActiveWorkbenchWindow();
if (window != null) {
IWorkbenchPage page = window.getActivePage();
if (page != null) {
IViewPart consoleView =
page.findView(IConsoleConstants.ID_CONSOLE_VIEW);
if (consoleView == null) {
IWorkbenchPart activePart = page.getActivePart();
try {
consoleView =
page.showView(IConsoleConstants.ID_CONSOLE_VIEW);
} catch (PartInitException pie) {
CUIPlugin.log(pie);
}
// restore focus stolen by the creation of the
// console
page.activate(activePart);
} else {
boolean bringToTop = true;
if (bringToTop) {
page.bringToTop(consoleView);
}
}
}
}
}
});
}
Finally got it to work. The main change I've made is having my MyLaunchConfigurationDelegate extend LaunchConfigurationDelegate instead of just implementing ILaunchConfigurationDelegate. When observed through the debugger, the launch() method went through similar code path as external process that was launched via External Tools when MyLaunchConfigurationDelegate extended LaunchConfigurationDelegate.
I guess it was lack of information on my part but I wasn't sure which part of the code was more important to share.
Another piece of code that was removed was:
IProcess dbgProcess = DebugPlugin.newProcess(launch, compilerProcess, "XVR Compiler", processAttributes);
...
launch.removeProcess(dbgProcess);
I've added it while attempting different approach in debugging this issue and it actually caused more issues by removing the debugProcess before it has chance to display output to the console.