File tree 1 file changed +10
-5
lines changed
1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -121,9 +121,14 @@ The program below exemplifies how to use logging: ::
121
121
122
122
import argparse
123
123
import logging
124
+
124
125
from artiq.tools import verbosity_args, init_logger
125
126
126
127
128
+ # get a logger that prints the module name
129
+ logger = logging.getLogger(__name__)
130
+
131
+
127
132
def get_argparser():
128
133
parser = argparse.ArgumentParser(description="Logging example")
129
134
parser.add_argument("--someargument",
@@ -137,11 +142,11 @@ The program below exemplifies how to use logging: ::
137
142
args = get_argparser().parse_args()
138
143
init_logger(args) # This initializes logging system log level according to -v/-q args
139
144
140
- logging .debug("this is a debug message")
141
- logging .info("this is an info message")
142
- logging .warning("this is a warning message")
143
- logging .error("this is an error message")
144
- logging .critical("this is a critical message")
145
+ logger .debug("this is a debug message")
146
+ logger .info("this is an info message")
147
+ logger .warning("this is a warning message")
148
+ logger .error("this is an error message")
149
+ logger .critical("this is a critical message")
145
150
146
151
if __name__ == "__main__":
147
152
main()
You can’t perform that action at this time.
0 commit comments