Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log file of current hour gets overwritten by default #809

Closed
4 of 8 tasks
abitmore opened this issue Apr 3, 2018 · 50 comments
Closed
4 of 8 tasks

Log file of current hour gets overwritten by default #809

abitmore opened this issue Apr 3, 2018 · 50 comments
Assignees
Labels
1b User Story The User Story details a requirement. It may reference a parent Epic. It may reference child Task(s) 2h Accepted Status indicating the solution passed final review, and is ready for implementation 3d Bug Classification indicating the existing implementation does not match the intention of the design 6 UX Impact flag identifying the User Interface (UX) bug good first issue logging

Comments

@abitmore
Copy link
Member

abitmore commented Apr 3, 2018

Steps to reproduce:

  • change config.ini so default log will be written to file
# declare an appender named "default" that writes messages to default.log
[log.file_appender.default]
filename=logs/default/default.log
# filename can be absolute or relative to this config file

# route any messages logged to the default logger to the "stderr" logger and "default" logger we
# declared above, if they are info level are higher
[logger.default]
level=info
appenders=stderr,default
  • start witness_node
  • stop witness_node
  • check log file (witness_node_data_dir/logs/default/default.log)
  • start witness_node again
  • check log file (witness_node_data_dir/logs/default/default.log)

The log file will be overwritten on restart.

IMHO the default behavior should be appending but not overwriting.

CORE TEAM TASK LIST

  • Evaluate / Prioritize Feature Request
  • Refine User Stories / Requirements
  • Define Test Cases
  • Design / Develop Solution
    • Issue estimation: 2 hours
    • Issue assigned to @nanomobile
  • Perform QA/Testing
  • Update Documentation
@clockworkgr
Copy link
Member

clockworkgr commented Apr 5, 2018

Not completely confident in C++ coding yet to simply do a PR, but since I wanna start getting involved, I just wanna run this by you.

It seems that here:
https://github.com/bitshares/bitshares-fc/blob/master/src/log/file_appender.cpp#L148

The file is opened , passing a bitmask for write & append mode.

However, here:
https://github.com/bitshares/bitshares-fc/blob/master/src/io/fstream.cpp#L32

It seems like the bitmask passed is ignored and opening in binary mode is hardcoded in instead.

I assume the correct way of tackling this is to fix fstream.cpp to use the bitmask passed and visit all calls to open() to make sure that binary mode is added to the bitmask.

Am I correct in any of this?

@ryanRfox ryanRfox added 1b User Story The User Story details a requirement. It may reference a parent Epic. It may reference child Task(s) 2c Ready for Development Status indicating the Requirements are sufficent to begin designing a solution 3c Enhancement Classification indicating a change to the functionality of the existing imlementation 6 UX Impact flag identifying the User Interface (UX) labels May 24, 2018
@abitmore abitmore added this to the Future Non-Consensus-Changing Release milestone May 25, 2018
@nanomobile
Copy link
Contributor

I want to claim this issue, help me guys please to make correct workflow for first time

@ryanRfox ryanRfox added 2d Developing Status indicating currently designing and developing a solution 3d Bug Classification indicating the existing implementation does not match the intention of the design and removed 2c Ready for Development Status indicating the Requirements are sufficent to begin designing a solution 3c Enhancement Classification indicating a change to the functionality of the existing imlementation labels Jun 15, 2018
@ryanRfox
Copy link
Contributor

@nanomobile has claimed this Issue. I've moved it to the Community Claims project board. The OP provides hints for a Test Case. Also, @clockworkgr provides hints above for potential fixes within fstream.cpp and confirmed by @abitmore . Please begin your local development with a checkout from the develop branch. Please rebase your local feature branch prior to creating your PR to develop.

@ryanRfox ryanRfox self-assigned this Jun 15, 2018
@nanomobile
Copy link
Contributor

how much hours is reserved for this issue ?

@nanomobile
Copy link
Contributor

What is your estimates on this issue so the Community know how many hours it is expected to take ?

@ryanRfox
Copy link
Contributor

@nanomobile Checking with Core Team devs for assistance with estimation...

@nanomobile
Copy link
Contributor

nanomobile commented Jun 19, 2018 via email

@oxarbitrage
Copy link
Member

i am not very good in estimations but i will say it will take 1 hour to someone with the needed knowledge of git and bitshares. clockwork already pointed to some code where it can be fixed. it could take some more(2 hours) to someone not that familiar with any of this but i think not much more than that in this particular case.

the estimations in general i think can be done with a floor of no less than 1 hour and a variable roof in case something is more complicated than initially estimated or reviewers request changes to the code, etc)

@nanomobile
Copy link
Contributor

while debugging I found that problem isn't located as clockwork wrote.

@clockworkgr
Copy link
Member

Yeah, don't take my comment as gospel...my c++ knowledge is rudimentary at best...I just wanted to know if I was thinking across the right lines

@nanomobile
Copy link
Contributor

yes sure ! Understood ! I thought the same as you ;-) Just checked your version :-) I thought you're right and I can fix it less than 1 hour :-) but need to research & debug more ...

@oxarbitrage
Copy link
Member

can be extended to 2 hours without problems IMO.

@jmjatlanta
Copy link
Contributor

I'd say 1 1/2 to 2hr is fair.

** Warning... Soapbox **
While some may balk at the time it takes to handle a task, please remember that often this must include research, estimation, consultation, implementation, testing, and documentation.

I'm not saying this task requires all these steps. But coding time is only part of the equation. Often, we attack a problem only to find that it affects something else. Or find that if we do it the right way, we also have to adjust this "other thing over there".

My $0.02 (includes the $0.02 VAT), is that the potential candidate should have a clear understanding of what is expected, and can assist in the estimation. The first few attempts are a learning experience, and often cost the developer. But the rewards are there for endurance (speaking from experience on this point).

If tasks grow beyond the initial requirements (this happens more often than we want), we should reward the developer for the value of what they were able to accomplish, even if the results are only documentation of a deeper problem.
** stepping down from soapbox **

@abitmore
Copy link
Member Author

abitmore commented Jul 4, 2018

I've mentioned my opinions above, quoting here:

  • change the type of the 2nd parameter to std::ios_base::openmode mode, and
    • change the default value to std::ios_base::out | std::ios_base::binary
    • if the 2nd parameter is set, open the file with std::ios_base::out | std::ios_base::binary | the_given_value

@jmjatlanta
Copy link
Contributor

I'd say @abitmore has a good solution. That would require the minimal amount of changes to source code and fix the current problem. I think a separate issue should be created to refactor fc::fstream so as to be consistent with standard fstream expectations (i.e. text mode). I will create that issue.

@nanomobile
Copy link
Contributor

so @abitmore 's solution is the best ? right ? Should I implement it ? does anybody disagree ?

@nanomobile
Copy link
Contributor

@abitmore yes I mean ifstream has binary issue, the same situation means that there is issue too with ifstream :-)

@nanomobile
Copy link
Contributor

nanomobile commented Jul 6, 2018

new changes in PR are ready
bitshares/bitshares-fc#56

bitshares/bitshares-fc@71b6f15

@abitmore @oxarbitrage @jmjatlanta @ryanRfox @clockworkgr so we can close this issue and merge changes from this PR ?

nanomobile pushed a commit to nanomobile/bitshares-core that referenced this issue Jul 6, 2018
nanomobile pushed a commit to nanomobile/bitshares-core that referenced this issue Jul 6, 2018
nanomobile pushed a commit to nanomobile/bitshares-core that referenced this issue Jul 7, 2018
nanomobile pushed a commit to nanomobile/bitshares-core that referenced this issue Jul 7, 2018
nanomobile pushed a commit to nanomobile/bitshares-core that referenced this issue Jul 7, 2018
nanomobile added a commit to nanomobile/bitshares-core that referenced this issue Jul 9, 2018
nanomobile added a commit to nanomobile/bitshares-core that referenced this issue Jul 9, 2018
nanomobile added a commit to nanomobile/bitshares-core that referenced this issue Jul 9, 2018
@jmjatlanta jmjatlanta mentioned this issue Jul 27, 2018
@abitmore
Copy link
Member Author

Fixed with #1104.

@pmconrad pmconrad added 2h Accepted Status indicating the solution passed final review, and is ready for implementation and removed 2a Discussion Needed Prompt for team to discuss at next stand up. 2d Developing Status indicating currently designing and developing a solution labels Jul 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1b User Story The User Story details a requirement. It may reference a parent Epic. It may reference child Task(s) 2h Accepted Status indicating the solution passed final review, and is ready for implementation 3d Bug Classification indicating the existing implementation does not match the intention of the design 6 UX Impact flag identifying the User Interface (UX) bug good first issue logging
Projects
None yet
Development

No branches or pull requests

7 participants