summaryrefslogtreecommitdiffstats
path: root/yocto-poky/bitbake/lib/prserv/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'yocto-poky/bitbake/lib/prserv/__init__.py')
-rw-r--r--yocto-poky/bitbake/lib/prserv/__init__.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/yocto-poky/bitbake/lib/prserv/__init__.py b/yocto-poky/bitbake/lib/prserv/__init__.py
new file mode 100644
index 000000000..c3cb73ad9
--- /dev/null
+++ b/yocto-poky/bitbake/lib/prserv/__init__.py
@@ -0,0 +1,14 @@
+__version__ = "1.0.0"
+
+import os, time
+import sys,logging
+
+def init_logger(logfile, loglevel):
+ numeric_level = getattr(logging, loglevel.upper(), None)
+ if not isinstance(numeric_level, int):
+ raise ValueError('Invalid log level: %s' % loglevel)
+ FORMAT = '%(asctime)-15s %(message)s'
+ logging.basicConfig(level=numeric_level, filename=logfile, format=FORMAT)
+
+class NotFoundError(Exception):
+ pass
OpenPOWER on IntegriCloud