Esempio n. 1
0
 def process_item(self, item, spider):
     m1 = MyLog()
     today = time.strftime('%Y%m%d', time.localtime())
     fileName = 'weather' + today + '.json'
     m1.error('转换json开始')
     with codecs.open(fileName, 'a', encoding='utf8') as fp:
         line = json.dumps(dict(item), ensure_ascii=False) + '\n'
         fp.write(line)
     m1.warn('转换json结束')
     return item
Esempio n. 2
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from myLog import MyLog

if __name__ == '__main__':
    ml = MyLog()
    ml.debug("I am the debug message")
    ml.info("I am the info message")
    ml.warn("I am the warn message")
    ml.error("I am the error message")
    ml.critical("I am the critical message")
Esempio n. 3
0
from myLog import MyLog
if __name__ == '__main__':
    ml = MyLog()
    ml.debug("1'm a debug message")
    ml.info("I'm an info message")
    ml.warn("I'm a warn message")
    ml.error("I'm an error message")
    ml.critical("I'm a critical message")
Esempio n. 4
0
#!/usr/bin/env python
#-*- coding: utf-8 -*-
__author__ = 'hstking [email protected]'

from myLog import MyLog

if __name__ == '__main__':
    ml = MyLog()
    ml.debug('I am debug message')
    ml.info('I am info message')
    ml.warn('I am warn message')
    ml.error('I am error message')
    ml.critical('I am critical message')
Esempio n. 5
0
#!/usr/bin/env python
#-*- coding:utf-8 -*-
from myLog import MyLog

if __name__ == "__main__":
    ml = MyLog()
    ml.debug('debug')
    ml.info('info')
    ml.warn('warn')
    ml.error('error')
    ml.critical('critical')