Skip to content

Commit ab53282

Browse files
author
César Román
authored
feat(ia): implement all LoggerEx functions (#27)
This change adds the following supporting packages: * org.apache.lang3 * org.slf4j
1 parent 17e7688 commit ab53282

File tree

7 files changed

+454
-7
lines changed

7 files changed

+454
-7
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ This package includes supporting classes and interfaces from Apache Commons Math
115115

116116
This package includes supporting Jython classes and interfaces. For more information, see documentation here: <https://www.javadoc.io/doc/org.python/jython-standalone/2.7.2/index.html>.
117117

118+
#### org.slf4j
119+
120+
This package includes supporting classes and interfaces from SLF4J API Module. For more information, see documentation here: <https://www.javadoc.io/doc/org.slf4j/slf4j-api/1.7.26/overview-summary.html>.
121+
118122
#### system
119123

120124
This package includes all Ignition Scripting Functions. For more information, see documentation here: <https://docs.inductiveautomation.com/display/DOC81/System+Functions>.
Lines changed: 171 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
__all__ = ["LoggerEx"]
22

3-
from java.lang import Object
3+
from typing import Any, Optional, Union
4+
5+
from java.io import Closeable
6+
from java.lang import AutoCloseable, Class, Object, Throwable
7+
from org.apache.commons.lang3.builder import ToStringStyle
8+
from org.slf4j import Logger
9+
10+
String = Union[str, unicode]
411

512

613
class LoggerEx(Object):
@@ -11,15 +18,175 @@ class LoggerEx(Object):
1118
builder.
1219
"""
1320

14-
def __init__(self):
21+
DEFAULT_TO_STRING_STYLE = None # type: ToStringStyle
22+
23+
def createSubLogger(self, arg):
24+
# type: (Union[Class, String]) -> LoggerEx
25+
pass
26+
27+
def debug(self, message, t=None):
28+
# type: (String, Optional[Throwable]) -> None
29+
pass
30+
31+
def debugDuration(self, message):
32+
# type: (String) -> Closeable
33+
pass
34+
35+
def debugEvent(self, message, *args):
36+
# type: (String, Any) -> None
37+
pass
38+
39+
def debugf(self, message, *args):
40+
# type: (String, Any) -> None
41+
pass
42+
43+
def error(self, message, t=None):
44+
# type: (String, Optional[Throwable]) -> None
45+
pass
46+
47+
def errorEvent(self, message, *args):
48+
# type: (String, Any) -> None
49+
pass
50+
51+
def errorf(self, message, *args):
52+
# type: (String, Any) -> None
53+
pass
54+
55+
def fatal(self, message, t=None):
56+
# type: (String, Optional[Throwable]) -> None
1557
pass
1658

17-
def getLogger(self):
59+
def getIdentObject(self):
60+
# type: () -> Object
61+
pass
62+
63+
def getLoggerSLF4J(self):
64+
# type: () -> Logger
1865
pass
1966

2067
def getName(self):
68+
# type: () -> String
69+
pass
70+
71+
def getToStringStyle(self):
72+
# type: () -> ToStringStyle
73+
pass
74+
75+
def info(self, message, t=None):
76+
# type: (String, Optional[Throwable]) -> None
77+
pass
78+
79+
def infoDuration(self, message):
80+
# type: (String) -> Closeable
81+
pass
82+
83+
def infoEvent(self, message, *args):
84+
# type: (String, Any) -> None
85+
pass
86+
87+
def infof(self, message, *args):
88+
# type: (String, Any) -> None
89+
pass
90+
91+
def isDebugEnabled(self):
92+
# type: () -> bool
93+
pass
94+
95+
def isIdentObjectEnabled(self):
96+
# type: () -> bool
97+
pass
98+
99+
def isInfoEnabled(self):
100+
# type: () -> bool
101+
pass
102+
103+
def isTraceEnabled(self):
104+
# type: () -> bool
105+
pass
106+
107+
def mdcClose(self):
108+
# type: () -> None
109+
pass
110+
111+
def mdcPut(self, key, value):
112+
# type: (String, String) -> None
113+
pass
114+
115+
def mdcPutCloseable(self, key, value):
116+
# type: (String, String) -> LoggerEx.MDCCloseable
117+
pass
118+
119+
def mdcRemove(self, key):
120+
# type: (String) -> None
121+
pass
122+
123+
def mdcSet(self):
124+
# type: () -> LoggerEx.MDCCloseable
21125
pass
22126

23127
@staticmethod
24-
def log(*args):
128+
def newBuilder():
129+
# type: () -> LoggerEx.Builder
130+
pass
131+
132+
def setIdentObject(self, identObj):
133+
# type: (Object) -> None
134+
pass
135+
136+
def setToStringStyle(self, toStringStyle):
137+
# type: (ToStringStyle) -> None
138+
pass
139+
140+
def trace(self, message, t=None):
141+
# type: (String, Optional[Throwable]) -> None
25142
pass
143+
144+
def traceDuration(self, message):
145+
# type: (String) -> Closeable
146+
pass
147+
148+
def traceEvent(self, message, *args):
149+
# type: (String, Any) -> None
150+
pass
151+
152+
def tracef(self, message, *args):
153+
# type: (String, Any) -> None
154+
pass
155+
156+
def warn(self, message, t=None):
157+
# type: (String, Optional[Throwable]) -> None
158+
pass
159+
160+
def warnEvent(self, message, *args):
161+
# type: (String, Any) -> None
162+
pass
163+
164+
def warnf(self, message, *args):
165+
# type: (String, Any) -> None
166+
pass
167+
168+
class Builder(Object):
169+
def build(self, *args):
170+
# type: (Any) -> LoggerEx
171+
pass
172+
173+
def eventSystem(self, systemId):
174+
# type: (str) -> LoggerEx.Builder
175+
pass
176+
177+
def identObject(self, identObj):
178+
# type: (Object) -> LoggerEx.Builder
179+
pass
180+
181+
def mdcContext(self, *args):
182+
# type: (Object) -> LoggerEx.Builder
183+
pass
184+
185+
def mutableIdentObject(self, identObj):
186+
# type: (Object) -> LoggerEx.Builder
187+
pass
188+
189+
class MDCCloseable(Object, AutoCloseable):
190+
def close(self):
191+
# type: () -> None
192+
pass

src/java/io/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from __future__ import print_function
88

99
__all__ = [
10+
"Closeable",
1011
"DataOutputStream",
1112
"FileDescriptor",
1213
"FileOutputStream",
@@ -16,7 +17,13 @@
1617
"PrintStream",
1718
]
1819

19-
from java.lang import Object
20+
from java.lang import AutoCloseable, Object
21+
22+
23+
class Closeable(AutoCloseable):
24+
def close(self):
25+
# type: () -> None
26+
raise NotImplementedError
2027

2128

2229
class FileDescriptor(Object):

0 commit comments

Comments
 (0)