Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve logging #3405

Merged
merged 2 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/nl/hannahsten/texifyidea/psi/LatexPsiHelper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ class LatexPsiHelper(private val project: Project) {
}
else {
if (closeBracket?.treeParent != optionalParam.node) {
Log.error("Close bracket is not a child of the optional parameter for ${command.text}, name=$name, value=$value")
Log.debug("Close bracket is not a child of the optional parameter for ${command.text}, name=$name, value=$value")
return null
}
val comma = createFromText(",").firstChildOfType(LatexNormalText::class)?.firstChild ?: return pair
optionalParam.addBefore(comma, closeBracket)
Expand Down
3 changes: 2 additions & 1 deletion src/nl/hannahsten/texifyidea/util/SystemEnvironment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import org.apache.maven.artifact.versioning.DefaultArtifactVersion
import java.io.File
import java.io.IOException
import java.util.concurrent.TimeUnit
import javax.swing.SwingUtilities

/**
* Information about the system other than the LatexDistribution or the OS.
Expand Down Expand Up @@ -70,7 +71,7 @@ fun runCommand(vararg commands: String, workingDirectory: File? = null): String?
* @param returnExceptionMessage Whether to return exception messages if exceptions are thrown.
*/
fun runCommandWithExitCode(vararg commands: String, workingDirectory: File? = null, timeout: Long = 3, returnExceptionMessage: Boolean = false, nonBlocking: Boolean = false): Pair<String?, Int> {
Log.debug("Executing in ${workingDirectory ?: "current working directory"} ${GeneralCommandLine(*commands).commandLineString}")
Log.debug("isEDT=${SwingUtilities.isEventDispatchThread()} Executing in ${workingDirectory ?: "current working directory"} ${GeneralCommandLine(*commands).commandLineString}")
return try {
val proc = GeneralCommandLine(*commands)
.withParentEnvironmentType(GeneralCommandLine.ParentEnvironmentType.CONSOLE)
Expand Down
Loading