KSL

object KSL(source)

Properties

Link copied to clipboard

Controls whether consoleAdvisory and consoleDiagnostic write to the console in addition to logging. Defaults to true so that users who never look at log files (especially students running models from an IDE) see mistake-preventing advisories directly in their console. Headless or test environments can suppress console output by setting the system property ksl.consoleAdvisories to false or by assigning this property.

Link copied to clipboard

the path to the default comma-separated value file directory

Link copied to clipboard
val dbDir: Path

the path to the default database directory

Link copied to clipboard

the path to the default Excel directory

Link copied to clipboard
val logger: KLogger

A global logger for logging

Link copied to clipboard

Should be used by classes to get the next constant so that unique constants can be used

Link copied to clipboard

Use with println(), but it goes to a file called kslOutput.txt

Link copied to clipboard

the path to the base directory

Link copied to clipboard

the path to the default file directory for plotting output

Functions

Link copied to clipboard
fun consoleAdvisory(logger: KLogger, message: () -> String)

Emits a usability advisory. The message is always logged at WARN via the supplied logger and, unless consoleAdvisoriesOption is false, is also printed to standard output with a "KSL ADVISORY:" prefix.

Link copied to clipboard
fun consoleDiagnostic(logger: KLogger, message: () -> String)

Emits a failure diagnostic. The message is always logged at ERROR via the supplied logger and, unless consoleAdvisoriesOption is false, is also printed to standard error.

Link copied to clipboard
fun createFile(fileName: String): File

Makes a new file within the base directory with the given file name

Link copied to clipboard

Makes a new PrintWriter within the base directory with the given file name

Link copied to clipboard

Makes a Path to the named subdirectory within the base directory

Link copied to clipboard
fun outputSubPath(dirName: String): Path

Resolves a path to the named subdirectory under the base output directory WITHOUT creating it. This is the path-only sibling of createSubDirectory.

Link copied to clipboard
Link copied to clipboard
open override fun toString(): String