How to append developer logs in a Dart CLI application - dart

Dart natively supports a developer log function, which in Flutter automatically appends logging output to the device log.
But when I build a (server) CLI application in Dart, these logs appear to be only accessible via DevTools.
Where can I find the API to build a custom appender?
(Or is there already a Pub package that can append to console and/or rotating log files?)

Related

Loopback Controller APIs not working inside electron app

I am trying to run a loopback based application inside by electron app. I was successful in configuring SQLite into loopback and also DB migration inside the app. The server runs fine inside electron in debug mode and I am able to access API endpoints that I created. But when I package the app and run the .app file, the server starts up fine but there are no API endpoints. Here is the link to code: https://github.com/sahilanguralla/daakiya

How WebStorm runs Dart web apps

When running a Dart web app in WebStorm, the "Pub Serve" tab on the ? pane at the bottom reports the following (--port differs from run to run):
/home/tom/dart-sdk/bin/pub serve web --port=46247
Loading source assets...
Loading polymer transformers...
Serving polymer_and_dart web on http://localhost:46247
However, the app will be accessible at http://localhost:63342.
Yet when I run pub serve from the command line, the app will be accessible at localhost:46247:
/home/tom/dart-sdk/bin/pub serve web --port=46247
Can someone explain what WebStorm is doing at the specified port, if it is not to serve the app?
BTW, I am using only Dartium in development.
WebStorm has an integrated proxy that listens on its own port and just forwards to the port pub serve is listening on.
pub serve will be removed in Dart 2.
Currently 4/2018 there is no integration of pub run build_runner serve with IntelliJ but it is work in progress.
Webstorm 2018.1 seems to do something a little different from a proxy. Webstorm runs a web server at the debug port that will respond with a 302 redirect when it receives a GET http://localhost:{{debugPort}}/web/web/{{targetPage}}. The redirect's Location header will refer to the actual location of the target page in the Dart web app.
If, by some chance you need to get the random port programmatically during development, you can enable "Allow unsigned requests" in the Webstorm debugger settings and then write some scaffolding code to get the Location header.

Visual Studio 2015 for Cordova - Can't build for iOS

I have successfully built my project for Android but during building for iOS I get an error:
The remote build server denied the build request, because the client
certificate is invalid or has expired. To build your project, you must
generate and configure a security PIN. See
http://go.microsoft.com/fwlink/?LinkID=511904
I have generated a new pin (after doing a resetServerCert, followed by a generateClientCert), as described in the link above, I reinstalled the remotebuild tool, but all to no avail. It also doesn't matter if I just try to build or build/deploy to a local device.
I also tried building without pin, but that doesn't work either:
Cannot POST
/build/tasks?command=build&vcordova=5.1.1&cfg=debug&options=--device
I am close to releasing my app, but the issues above have set me back a couple of days.
Any suggestions?
From your comment that VS is trying to POST //build/tasks?command=build&vcordova it looks like it isn't configured properly: That empty URL segment should be "cordova", and that is discovered when you configure VS to talk to the remote agent in tools -> options.
If you go to Tools -> Options -> Tools for Apache Cordova -> Remote Agent Configuration and reconfigure your settings (Either disabling secure mode on the mac server, or generating a new pin to use) then VS should be able to connect.
I finally got my first successful build after going through this page: https://github.com/Microsoft/cordova-docs/blob/master/known-issues/known-issues-ios.md
The issue was that I first had vs-mda-remote installed and then changed to remotebuild. You have to follow these steps in this situation:
generate and use a new PIN
If you are not using secure mode, turn secure mode on
Turn secure mode off again to cause VS to reinitalize

How do I view the Jenkins server console output on the local filesystem?

I'm using the Jenkins Active Directory plug-in and can't log in after several attempts.
The error message says:
If you are a system administrator and suspect this to be a configuration problem, see the server console output for more details.
Where can I find the server console output (on the local filesystem)?
I presume that it is accessible from the Jenkins web pages, but since I can't log in, that's not much use. I can log in to the (Windows) server where Jenkins is installed - where are they on the server?
The console output you are looking for are not accessible from Jenkins. If you have installed Jenkins as a service, when that service is started three files are created in JENKINS_HOME: jenkins.err.log, jenkins.out.log, and jenkins.wrapper.log. The relevant ones for you are jenkins.err.log and jenkins.out.log.
If you used the default location you can find them in C:\Program Files (x86)\Jenkins.
In more recent versions you can tail the logs under $JENKINS_HOME/support/all_[date].log. It outputs all relevant information when you're modifying settings on the Web console and such.

Trying to debug adapter Java Code in worklight 6.1

I'm trying to debug worklight 6.1 adapter code (java). I figured the most logical way would be to restart the imbedded liberty server in debug mode. That fails with a message:
ERROR: Cannot load this JVM TI agent twice, check your java command line for duplicate jdwp options.
Error occurred during initialization of VM
agent library failed to init: jdwp
I followed the process documented for 6.0 at Logging and debugging Java on Worklight Server but I get the same issue there.
Ok, this is silly, but I just figured it out. You do not need to set anything for debug mode. Apparently in 6.1 this is already set. To begin debugging of your java code in the adapter you need to do the following:
Create a debug configuration for a "Remote Java Application".
Set the project to your worklight hybrid project
I set the port to 10777. which is what jdwp was set to in the jvm.options file for the worklight server.
Once you click on debug for that configuration, it will allow you to debug your adapter.
You can see the jvm.options file if you expand the Worklight Development Server definition in the Servers view. See below for an example of the contents of that file.
-Dfile.encoding=UTF-8
-Duser.language=en
-Duser.country=US
-Djava.awt.headless=true
-Dwas.debug.mode=true
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=10777
-Dcom.ibm.websphere.ras.inject.at.transform=true
Uploaded video to youtube on how to do this

Resources