wvaske / pbk Goto Github PK
View Code? Open in Web Editor NEWPerflosopher's Benchmarking Kit is a set of scripts to automate system benchmarks and data collection
License: MIT License
Perflosopher's Benchmarking Kit is a set of scripts to automate system benchmarks and data collection
License: MIT License
I'm not sure if you've run into this but I'm using your logger for the work I'm doing (so great!). If you try to do the simple case of pickle on the PerfLogger:
from pbk.util.perflogger import configure_basic_logger
logger = configure_basic_logger('test')
import pickle
pickle.dumps(logger)
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/opt/.../python3.8/logging/__init__.py", line 1727, in __reduce__
raise pickle.PicklingError('logger cannot be pickled')
_pickle.PicklingError: logger cannot be pickled
Below is the code segment in question:
def __reduce__(self):
# In general, only the root logger will not be accessible via its name.
# However, the root logger's class has its own __reduce__ method.
if getLogger(self.name) is not self:
import pickle
raise pickle.PicklingError('logger cannot be pickled')
return getLogger, (self.name,)
Pretty much, when getLogger is called on Perflogger the value returned is not the same as what is given for the root logger. In other words, the value the root logger gets with getLogger is not the same as PerfLogger __repr__
:
logger
<PerfLogger test (DEBUG)>
logging.getLogger(logger.name)
<PerfLogger test (WARNING)>
Hopefully, the fix should be easy. I'll fix it in my environment before i need to actually need to pickle. I wanted to give you a heads up in case you wanted to fix it before I submit a PR sometime this week.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.