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

new login routine in dev branch? #3762

Closed
Gurzeh opened this issue Aug 12, 2016 · 5 comments
Closed

new login routine in dev branch? #3762

Gurzeh opened this issue Aug 12, 2016 · 5 comments

Comments

@Gurzeh
Copy link
Contributor

Gurzeh commented Aug 12, 2016

Expected Behavior

Usual logs

Actual Behavior

new logs, like
[17:39:20] {'distance_unit': '', 'distance': '', 'current_position': (long, lat), 'last_position': (long, lat,)}

I searched for the central routine printing.
I guess I found it in event_manager.py like: event_report method of event_manager
or in event_handlers
Am I right? Cause I would like to customize the behavior.

Your config.json (remove your credentials and any other private info)

{
"auth_service": "google",
"username": "",
"password": "",
"location": "",
"gmapkey": "",
"tasks": [
{
"type": "HandleSoftBan"
},
{
"type": "SleepSchedule",
"config": {
"enabled": false,
"time": "23:54",
"duration":"7:46",
"time_random_offset": "00:24",
"duration_random_offset": "00:43"
}
},
{
"type": "CollectLevelUpReward"
},
{
"type": "IncubateEggs",
"config": {
"longer_eggs_first": true
}
},
{
"type": "UpdateLiveStats",
"config": {
"enabled": false,
"min_interval": 10,
"stats": ["uptime", "stardust_earned", "xp_earned", "xp_per_hour", "stops_visited"],
"terminal_log": true,
"terminal_title": true
}
},
{
"type": "TransferPokemon"
},
{
"type": "NicknamePokemon",
"config": {
"enabled": false,
"nickname_template": "{iv_pct}_{iv_ads}"
}
},
{
"type": "EvolvePokemon",
"config": {
"evolve_all": "none",
"first_evolve_by": "cp",
"evolve_above_cp": 10,
"evolve_above_iv": 0.2,
"logic": "or",
"evolve_speed": 20,
"use_lucky_egg": false
}
},
{
"type": "RecycleItems",
"config": {
"item_filter": {
"Pokeball": { "keep" : 150 },
"Potion": { "keep" : 10 },
"Super Potion": { "keep" : 20 },
"Hyper Potion": { "keep" : 30 },
"Revive": { "keep" : 30 },
"Razz Berry": { "keep" : 100 }
}
}
},
{
"type": "CatchVisiblePokemon"
},
{
"type": "CatchLuredPokemon"
},
{
"type": "SpinFort"
},
{
"type": "MoveToMapPokemon",
"config": {
"address": "http://localhost:5000",
"max_distance": 500,
"min_time": 60,
"min_ball": 50,
"prioritize_vips": true,
"snipe": true,
"snipe_high_prio_only": true,
"snipe_high_prio_threshold": 600,
"update_map": true,
"mode": "priority",
"catch": {
"Alakazam": 1000,
"Articuno": 1000,
"Chansey": 1000,
"Charizard": 1000,
"Charmeleon": 1000,
"Dewgong": 1000,
"Ditto": 1000,
"Farfetch'd": 1000,
"Kabutops": 1000,
"Kangaskhan": 1000,
"Lapras": 1000,
"Magneton": 1000,
"Mew": 1000,
"Mewtwo": 1000,
"Moltres": 1000,
"Mr. Mime": 1000,
"Muk": 1000,
"Primeape": 1000,
"Raichu": 1000,
"Rhydon": 1000,
"Snorlax": 1000,
"Tauros": 1000,
"Zapdos": 1000,

    "———— always catch ————": 0,
    "Dragonair":    1000,
    "Dragonite":    1000,
    "Dratini":  1000,

    "———— missing in Pokedex ————": 0,
    "Cubone":   1000,
    "Bulbasaur":    1000,
    "Ivysaur":  1000,

    "———— for better IV ————": 0,

    "———— for evolve ————": 0,
    "Abra":     800,
    "Charmander":   800,
    "Grimer":   800,
    "Kabuto":   800,
    "Kadabra":  800,
    "Magnemite":    800,
    "Mankey":   800,
    "Pikachu":  800,
    "Rhyhorn":  800,

    "———— best fighters ————": 0,
    "Arcanine":     700,
    "Blastoise":    700,
    "Exeggutor":    700,
    "Flareon":  700,
    "Gyarados":     700,
    "Poliwrath":    700,
    "Vaporeon":     700,
    "Venusaur":     700          }
    }
  },
  {
    "type": "MoveToFort",
    "config": {
        "lure_attraction": true,
        "lure_max_distance": 2000
    }
  },
  {
    "type": "FollowSpiral",
    "config": {
      "diameter": 4,
      "step_size": 70
    }
  }
],
"map_object_cache_time": 5,
"forts": {
  "avoid_circles": true,
  "max_circle_size": 50
},
"websocket_server": false,
"walk": 4.5,
"action_wait_min": 1,
"action_wait_max": 4,
"debug": false,
"test": false,
"health_record": true,
"location_cache": true,
"distance_unit": "km",
"reconnecting_timeout": 15,
"logging_color": true,
"evolve_captured": "none",
"catch_randomize_reticle_factor": 1.0,
"catch_randomize_spin_factor": 1.0,
"catch": {
  "any": {"catch_above_cp": 0, "catch_above_iv": 0, "logic": "or"},
}
"release": {
  "any": {"release_below_cp": 0, "release_below_iv": 0, "logic": "or"},
  "// Best fighters, keep 2:": {},
  "Arcanine": {"keep_best_iv": 2},
  "Dragonair": {"keep_best_iv": 2},
  "Dragonite": {"keep_best_iv": 2},
  "Dratini": {"keep_best_iv": 2},
  "Exxegutor": {"keep_best_iv": 2},
  "Flareon": {"keep_best_iv": 2},
  "Gyarados": {"keep_best_iv": 2},
  "Poliwrath": {"keep_best_iv": 2},
  "Slowbro": {"keep_best_iv": 2},
  "Vaporeon": {"keep_best_iv": 2},
  "Venusaur": {"keep_best_iv": 2},

"———— level final ————": 0,
  "Arbok": {"keep_best_iv": 1},
  "Beedrill": {"keep_best_iv": 1},
  "Butterfree": {"keep_best_iv": 1},
  "Clefable": {"keep_best_iv": 1},
  "Cloyster": {"keep_best_iv": 1},
  "Dodrio": {"keep_best_iv": 1},
  "Dugtrio": {"keep_best_iv": 1},
  "Fearow": {"keep_best_iv": 1},
  "Electabuzz": {"keep_best_iv": 1},
  "Electrode": {"keep_best_iv": 1},
  "Gengar": {"keep_best_iv": 1},
  "Golbat": {"keep_best_iv": 1},
  "Golduck": {"keep_best_iv": 1},
  "Golem": {"keep_best_iv": 1},
  "Hitmonchan": {"keep_best_iv": 1},
  "Hitmonlee": {"keep_best_iv": 1},
  "Hypno": {"keep_best_iv": 1},
  "Jolteon": {"keep_best_iv": 1},
  "Jynx": {"keep_best_iv": 1},
  "Kingler": {"keep_best_iv": 1},
  "Lickitung": {"keep_best_iv": 1},
  "Magmar": {"keep_best_iv": 1},
  "Marowak": {"keep_best_iv": 1},
  "Ninetales": {"keep_best_iv": 1},
  "Omastar": {"keep_best_iv": 1},
  "Onix": {"keep_best_iv": 1},
  "Parasect": {"keep_best_iv": 1},
  "Persian": {"keep_best_iv": 1},
  "Pidgeot": {"keep_best_iv": 1},
  "Pinsir": {"keep_best_iv": 1},
  "Ponyta": {"keep_best_iv": 1},
  "Porygon": {"keep_best_iv": 1},
  "Rapidash": {"keep_best_iv": 1},
  "Raticate": {"keep_best_iv": 1},
  "Scyther": {"keep_best_iv": 1},
  "Seadra": {"keep_best_iv": 1},
  "Seaking": {"keep_best_iv": 1},
  "Starmie": {"keep_best_iv": 1},
  "Tangela": {"keep_best_iv": 1},
  "Tentacruel": {"keep_best_iv": 1},
  "Venomoth": {"keep_best_iv": 1},
  "Victreebel": {"keep_best_iv": 1},
  "Weezing": {"keep_best_iv": 1},
  "Wigglytuff": {"keep_best_iv": 1},

"———— level 2 ————": 0,
  "Haunter": {"keep_best_iv": 1},
  "Ivysaur": {"keep_best_iv": 1},
  "Nidorina": {"keep_best_iv": 1},
  "Nidorino": {"keep_best_iv": 1},
  "Pidgeotto": {"keep_best_iv": 1},
  "Wartortle": {"keep_best_iv": 1},

"———— level 1 ————": 0,
  "Bulbasaur": {"keep_best_iv": 1},
  "Bellsprout": {"keep_best_iv": 1},
  "Clefairy": {"keep_best_iv": 1},
  "Cubone": {"keep_best_iv": 1},
  "Diglett": {"keep_best_iv": 1},
  "Doduo": {"keep_best_iv": 1},
  "Drowzee": {"keep_best_iv": 1},
  "Ekans": {"keep_best_iv": 1},
  "Fearow": {"keep_best_iv": 1},
  "Gastly": {"keep_best_iv": 1},
  "Geodude": {"keep_best_iv": 2},
  "Goldeen": {"keep_best_iv": 1},
  "Growlithe": {"keep_best_iv": 1},
  "Horsea": {"keep_best_iv": 1},
  "Jigglypuff": {"keep_best_iv": 1},
  "Kakuna": {"keep_best_iv": 1},
  "Koffing": {"keep_best_iv": 1},
  "Krabby": {"keep_best_iv": 1},
  "Magikarp": {"keep_best_iv": 1},
  "Meowth": {"keep_best_iv": 1},
  "Metapod": {"keep_best_iv": 1},
  "Nidoran F": {"keep_best_iv": 1},
  "Nidoran M": {"keep_best_iv": 1},
  "Paras": {"keep_best_iv": 1},
  "Poliwag": {"keep_best_iv": 1},
  "Poliwhirl": {"keep_best_iv": 1},
  "Ponyta": {"keep_best_iv": 1},
  "Psyduck": {"keep_best_iv": 1},
  "Rattata": {"keep_best_iv": 1},
  "Raticate": {"keep_best_iv": 1},
  "Shellder": {"keep_best_iv": 1},
  "Slowpoke": {"keep_best_iv": 1},
  "Spearow": {"keep_best_iv": 1},
  "Spearow": {"keep_best_iv": 1},
  "Squirtle": {"keep_best_iv": 1},
  "Staryu": {"keep_best_iv": 1},
  "Tentacool": {"keep_best_iv": 1},
  "Venonat": {"keep_best_iv": 1},
  "Voltorb": {"keep_best_iv": 1},
  "Vulpix": {"keep_best_iv": 1},
  "Zubat": {"keep_best_iv": 1},
  "Weepinbell": {"keep_best_iv": 1}
},
"vips" : {
     "Any pokemon put here directly force to use Berry & Best Ball to capture, to secure the capture rate!": {},
    "any": {"catch_above_cp": 1500, "catch_above_iv": 0.9, "logic": "or" },
    "Lapras": {},
    "Moltres": {},
    "Zapdos": {},
    "Articuno": {},

    "// S-Tier pokemons (if pokemon can be evolved into tier, list the representative)": {},
    "Mewtwo": {},
    "Dragonite": {},
    "Snorlax": {},
    "// Mew evolves to Mewtwo": {},
    "Mew": {},
    "Arcanine": {},
    "Vaporeon": {},
    "Gyarados": {},
    "Exeggutor": {},
    "Muk": {},
    "Weezing": {},
    "Flareon": {}

}

}
your config here


### Steps to Reproduce


### Other Information
OS:
Branch: dev or master
Git Commit: (run 'git log -n 1 --pretty=format:"%H"' and paste it here)
Python Version: (run 'python -V' and paste it here)
@Gurzeh Gurzeh changed the title new logic in dev branch? new login routine in dev branch? Aug 12, 2016
@foux
Copy link

foux commented Aug 12, 2016

The same logs are on master

@Gurzeh
Copy link
Contributor Author

Gurzeh commented Aug 12, 2016

Thanks @foux So nothing changed, because I don't remember master has colored logs?
And my question is "where is managed output?"

@foux
Copy link

foux commented Aug 12, 2016

Not the answer to your last question, but to the first one : yes logs are now coloured on master, and I do think that there was a change, because I don't remember those logs from yesterday

@Gurzeh
Copy link
Contributor Author

Gurzeh commented Aug 12, 2016

in fact, it is not that homogenous - which is common in dev this size with that many contributors
Most is printed by colored_logging_handler.py but I found other printing (for instance from event_manager.py)
I keep digging in. I might try a PR so you can configure the logs.
Also I wonder if they can be some file logging (other than using redirection >&x something)

Actually, there is a PR:
Add clean logging functionality with some other optimalisations
which is a very good start for what I was looking for.

@Gurzeh
Copy link
Contributor Author

Gurzeh commented Aug 12, 2016

ok, most logging logic is in:
colored_logging_handler.py : method handle_event (which prints a default message if arg is empty)
logging_handler.py : same

the default message is prepared by message = '{}'.format(str(data))

@Gurzeh Gurzeh closed this as completed Aug 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants