-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLog.java
More file actions
60 lines (54 loc) · 1.43 KB
/
Log.java
File metadata and controls
60 lines (54 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/**
* This file was automatically generated from Log.cs
* w/ further modifications by:
* @author Christoph M. Wintersteiger (cwinter)
**/
package com.microsoft.z3;
/**
* Interaction logging for Z3. <remarks> Note that this is a global, static log
* and if multiple Context objects are created, it logs the interaction with all
* of them. </remarks>
**/
public final class Log
{
private static boolean m_is_open = false;
/**
* Open an interaction log file. <param name="filename">the name of the file
* to open</param>
*
* @return True if opening the log file succeeds, false otherwise.
**/
public static boolean open(String filename)
{
m_is_open = true;
return Native.openLog(filename) == 1;
}
/**
* Closes the interaction log.
**/
public static void close()
{
m_is_open = false;
Native.closeLog();
}
/**
* Appends the user-provided string <paramref name="s"/> to the interaction
* log.
* @throws Z3Exception
**/
public static void append(String s) throws Z3Exception
{
if (!m_is_open)
throw new Z3Exception("Log cannot be closed.");
Native.appendLog(s);
}
/**
* Checks whether the interaction log is opened.
*
* @return True if the interaction log is open, false otherwise.
**/
public static boolean isOpen()
{
return m_is_open;
}
}