what does this mean in adb? "Note: log switch off, only log_main and log_events will have logs!" - switch-statement

when using adb to extract logcats on my Hhuawei Ascend P6 I get that note, and I see that many of my log statements are not present in the log.
what is the log switch and how do I turn it on?

From http://fanli7.net/a/bianchengyuyan/C__/20140325/483203.html (Chinese):
In the app, Phone, dial *#*#2846579#*#*. You may enter ProjectMenu.
According to the referenced link, you should do the following thing on 8813 and then reboot
ProjectMenu -> Background Settings -> LOG Settings -> Log Settings -> Turn on
And I do the folllwing on ALE-TL00:
Background Settings -> LOG Settings -> Log Settings -> turn on AP Log
It works

check if this file exist:
/dev/hwlog_switch
if exist, use this command to turn on log:
echo 1 > dev/hwlog_switch
if not exist, check if this file exist: /sys/kernel/logger/log_main/enable
if exist, use this command to turn on log:
echo 1 > /sys/kernel/logger/log_main/enable
if not exist again, I can't help you than...

This error happen to me just now after I pull from git. The log works fine before with *#*#2846579#*#* settings.
I tested with new project and it got log, only this old project has issue. I tried rebuild the app, re-enable the log via *#*#2846579#*#*, and even reboot phone, but still no luck.
Then I uninstall the app manually (Or all relevant productFlavors apps) in phone and rerun, the log was back.

Related

dotnet publish Error: The process cannot access the file because it is being used by another process

I get the following error when tring to run dotnet publish:
The process cannot access the file because it is being used by another
process.
This appears to happen when you try to publish your app and you have been viewing the published version in the browser, for some reason it locks out the files.
Full error message:
C:\Program Files\dotnet\sdk\2.2.301\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(169,5): warning MSB3026: Could not copy "obj\Debug\netcoreapp2.2\TemplateWebApp.dll" to "bin\Debug\netcoreapp2.2\publish\TemplateWebApp.dll". Beginning retry 1 in 1000ms. The process cannot access the file '\cpft-bi-web01\d$\Websites\TemplateWebApp\bin\Debug\netcoreapp2.2\publish\TemplateWebApp.dll' because it is being used by another process. [\cpft-bi-web01\d$\Websites\TemplateWebApp\TemplateWebApp.csproj]
I can resolve this by closing the browser and the restarting the website on IIS Manager but this is really not ideal, does anyone know the cause of this?
To solve it, i recycle the apppool.
On local environment, i have a Post Build Event Project -> Properties -> Build Events -> Post-build event command line, that runs a .bat file that sits in project directory.
This is the code from bat file:
%SYSTEMROOT%\System32\inetsrv\appcmd recycle apppool /apppool.name:"YOUR APP POOL NAME"
dotnet publish --force --no-build
pause
Just make sure you replace YOUR APP POOL NAME with your actual pool name (and keep the double quotes)
So every time i build the solution, it recycles the pool and publishes the app. Because i just build the app (right before publishing), i specify --no-build to publish command.
I had the same error. Stopping the application pool on IIS, then publishing, then starting the pool again worked for me.

Gradle Copy Task causes file permission issue

Background
I have a JetBrains Plugin that I am developing. Recently, I moved from a Windows to a Ubuntu system. I am trying to set up everything correctly as before. Note: I am fairly new to Linux.
Issue
I am having an apparent file permission issue (as can be seen in the error section of this question) when I ran the following Gradle script. Note: Whenever I build the project, this Gradle script is automatically called. It also worked correctly on Windows.
If I comment out the copy{...} closure then everything works correctly. I just need to manually copy over the required file.
tasks.create(name: "copyJar_v${project['version']}") {
group GROUP_CHROMATERIAL
def mostCurrentJarFile = "ChroMATERIAL-${project['version']}.jar"
// comment this out and there are not errors, but I need to do this copy manually
copy {
into '/' // Copy into project's root folder
from 'build/libs', {
include mostCurrentJarFile
rename mostCurrentJarFile, 'ChroMATERIAL.jar'
}
}
}
Error
FAILURE: Build failed with an exception.
* Where:
Build file
'/home/ciscorucinski/IdeaProjects/ChroMATERIAL/ChroMATERIAL/build.gradle' line: 100
* What went wrong:
A problem occurred evaluating project ':ChroMATERIAL'.
> Could not copy file '/home/ciscorucinski/IdeaProjects/ChroMATERIAL/ChroMATERIAL/build/libs/ChroMATERIAL-2.5.1.jar' to '/ChroMATERIAL.jar'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 0.139 secs
/ChroMATERIAL.jar (Permission denied)
오후 12:20:39: Task execution finished 'copyJar_v2.5.1'.
What I tried
I have been using the UI to modify the file permissions of the Plugin Project Folder within IdeaProjects.
I gave everyone Create and delete files permissions and I Change Permissions for Enclosing Files...
Everyone has Read and write access to files and Create and delete files access to folders.
Clicked Change
Run the Gradle script again ... same error message
Thoughts
It appears that Linux is not letting Gradle modify these files. I can comment out the code and do everything myself, but I need to allow Gradle to have higher control. Don't know how though.
I notice that when I go back to Change Permissions for Enclosing Files... the shown permissions are not what I selected! Others has Read-only access to files and Access files access to folders. I don't know if this is common Ubuntu behavior, a bug, or something else.
It would be nice to know how to give as restrictive as possible access while fixing this.
Well, it is true -- you cannot (and should not) copy files into the Root folder in a linux box. You could if you ran the script as sudo, but that is a bad idea.
Edited
Since you want to copy to the root of the project, you can use ${projectDir} or ${rootDir}.
Also, you should be able to do this without the hassle of a closure -- and it makes your script cleaner, IMHO -- by using the built in Copy task:
task copyClientLoc(type: Copy) {
from "build/libs/"
into "${rootDir}"
include "ChroMATERIAL-${project['version']}.jar"
fileMode = 0644
}

Gradle sync failing

Gradle sync failed:
Timeout waiting to lock file hash cache (C:\Users\HELLO\.gradle\caches\4.1\fileHashes). It is currently in use by another Gradle instance.
Owner PID: 10116
Our PID: 7136
Owner Operation:
Our operation:
Lock file: C:\Users\HELLO\.gradle\caches\4.1\fileHashes\fileHashes.lock
Consult IDE log for more details (Help | Show Log) (1m 23s 517ms)
-> Gradle build is failing
-> Unable to delete filehash lock file. It throws file in use
To handle this problem go through the following points.
Invalidate catch and and restart studio
If not work yet than Restart your computer
Go to file directory Restart your computer C:\Users\AdminUser .gradle\caches\4.1\fileHashes\ and delete filehash.lock
Now Restart your Studio it would work fine
Go to .gradle directory and delete all files in caches
Sometimes it was notable to delete filehash.lock file and it will throw an error unable to delete file. So do the following steps
For Windows machine:
Open Task Manager(Ctrl-Alt-Delete and check Process)
-> If you run two instance of android studio, Close One (End Task)
-> Then close OpenJDK Platform Binary
-> Gradle sync now on AndroidStudio and it will work now
Delete everything under below path.
C:\Users\HELLO\.gradle\caches\
There is a fileHashes.lock that is holding a global lock which is preventing you from running your script.

Azure Websites Git Deployment dropping "/" in SCM_BUILD_ARGS

Description
We are in a current project based on MVC4/Umbraco using Azure Websites to host it.
We are using SCM_BUILD_ARGS to change between different build setups depending on which site in Azure we deploy to (Test and Prod).
This is done by defining an app setting in the UI:
SCM_BUILD_ARGS = /p:Environment=Test
Earlier we used Bitbucket Integration to deploy and here this setting worked like a champ.
We have now switched to using Git Deployment, pushing the changes from our build server when tests have passed.
But when we do this, we get a lovely error.
"MSB1008: Only one project can be specified."
Trying to redeploy the same failed deployment from the UI on Azure works though.
After some trial and error I ended going into the deploy.cmd and outputting the %SCM_BUILD_ARGS% value in the script.
It looks like the / gets dropped from SCM_BUILD_ARGS but only when using Git deploy, not Bitbucket Integration or redeploy from UI.
Workaround
As workaround I have for now added a / to the deploy.cmd script in front of the %SCM_BUILD_ARGS%, but this of course breaks redeploy, since we then have //p:Environment=Test in the MSBuild command when the value of %SCM_BUILD_ARGS% has been inserted.
:: 2. Build to the temporary path
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
:: Added / to SCM_BUILD_ARGS
%MSBUILD_PATH% "%DEPLOYMENT_SOURCE%\www\www.csproj" [....] /%SCM_BUILD_ARGS%
) ELSE (
%MSBUILD_PATH% "%DEPLOYMENT_SOURCE%\www\www.csproj" [....] /%SCM_BUILD_ARGS%
)
Question
Anyone know of a better solution for this problem or is it possibly a bug in Kudu?
We would love to have both deploy from Git and Redeploy working.
Could you try changing from "/" to "-"? For instance, AppSettings from /p:Environment=Test to -p:Environment=Test, see if it helps.
-p:Environment=Test did not work for me, the setting which worked for me at the time of this writing (September 2015) was
-p:Configuration=Test
There is clearly a Kudu bug in there, and you should open an issue on https://github.com/projectkudu/kudu. But for now, I can give you a workaround.
Instead of using an App Setting, include a .deployment file at the root of your repo, containing:
[config]
SCM_BUILD_ARGS = /p:Environment=Test
I think this will work in all cases. I suspect the bug has to do with bash messing up the environment in post receive hook scenarios, which only apply to direct git push but not to Bitbucket and Redeploy scenarios.
UPDATE: In fact, it's easy to see such weird bash behavior. Try this:
Open cmd.exe
Run: set foo=/abc to set a variable
Run bash
From bash, run cmd to launch a new cmd on top of bash (so cmd -> bash -> cmd)
Run set foo to get the value of foo
Result:
FOO=C:/Program Files (x86)/git/abc
So the value gets completely messed up. The key also gets upper cases, though that's mostly harmless. Strange stuff...

Can't get azure web role to run locally using the emulator

I have a web role that I'm trying to run locally using the emulator. I have it working on another computer, but I cannot get it working on a different one, and have gone as far as to reformat it and start from scratch.
When I launch the site from Visual Studio, Chrome shows the following message:
This webpage is not available
The connection to 127.0.0.1 was interrupted.
There is also an error code listed at the bottom:
Error 101 (net::ERR_CONNECTION_RESET): The connection was reset.
One interesting thing from the build output are these lines:
Starting process 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\Windows Azure Tools\v1.8\Debugger\WindowsAzureDebugger.exe' with arguments '"C:\Program Files\IIS Express\iisexpress.exe" /trace:error /config:"C:\Users\brian\AppData\Local\dftmp\Resources\159c7254-b7d0-4076-a4fd-820b00feca5f\temp\temp\RoleTemp\applicationHost.config" /site:"deployment18(27).AzureApp.MyApp.Web_IN_0_Web"'...
Process 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\Windows Azure Tools\v1.8\Debugger\WindowsAzureDebugger.exe' exited with exit code 0.
If I run C:\Program Files\IIS Express\iisexpress.exe" /trace:error /config:"C:\Users\brian\AppData\Local\dftmp\Resources\159c7254-b7d0-4076-a4fd-820b00feca5f\temp\temp\RoleTemp\applicationHost.config" /site:"deployment18(27).AzureApp.MyApp.Web_IN_0_Web" from the command line, I get the following message:
The system cannot find the file specified.
Unable to start IIS Express in background.
I have no idea what file it cannot find, but I've verified that the config file I'm passing does in fact exist. Anyone have a clue what's going on here??
While I can not tell you what could be the actual root cause of your problem I can suggest a few ways to troubleshoot it:
Try changing IIS Express to Full IIS and see if it changes the behavior. You can do it by going to your Windows Azure Application project properties and look at "Web" option.
Try running application without debugging it
Launch CSrun at command prompt with /launchDebugger parameter of the /run option to verify that debugger does run without any issue
Try using IE as default browser
Clean your dftemp folder completely for any residual configuration and then launch Azure Emulator separately to verify there are no issues
Procmon "http://technet.microsoft.com/en-us/sysinternals/bb896645" may help you find the file that is missing...
Hopefully someone stumbles upon this answer with similar symptoms. When removing in role caching the <dataCacheClients> section was removed from . Somehow there was a left over <dataCacheClients> section left in the web.config. Everything and compiled and deployed to the emulator successfully. However, the role would fail to start since applicationHost.config was missing.
The fix was simply remove the unnecessary <dataCacheClients> section from the web.config file.

Resources